var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
    return typeof e;
} : function(e) {
    return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
};

!function(e, t) {
    "object" == ("undefined" == typeof exports ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = e || self).TIM = t();
}(void 0, function() {
    var r = "2.3.1", l = {
        SDK_READY: "sdkStateReady",
        SDK_NOT_READY: "sdkStateNotReady",
        SDK_DESTROY: "sdkDestroy",
        MESSAGE_RECEIVED: "onMessageReceived",
        CONVERSATION_LIST_UPDATED: "onConversationListUpdated",
        GROUP_LIST_UPDATED: "onGroupListUpdated",
        GROUP_SYSTEM_NOTICE_RECEIVED: "receiveGroupSystemNotice",
        PROFILE_UPDATED: "onProfileUpdated",
        BLACKLIST_UPDATED: "blacklistUpdated",
        KICKED_OUT: "kickedOut",
        ERROR: "error"
    }, B = {
        MSG_TEXT: "TIMTextElem",
        MSG_IMAGE: "TIMImageElem",
        MSG_SOUND: "TIMSoundElem",
        MSG_AUDIO: "TIMSoundElem",
        MSG_FILE: "TIMFileElem",
        MSG_FACE: "TIMFaceElem",
        MSG_VIDEO: "TIMVideoFileElem",
        MSG_GEO: "TIMLocationElem",
        MSG_GRP_TIP: "TIMGroupTipElem",
        MSG_GRP_SYS_NOTICE: "TIMGroupSystemNoticeElem",
        MSG_CUSTOM: "TIMCustomElem",
        CONV_C2C: "C2C",
        CONV_GROUP: "GROUP",
        CONV_SYSTEM: "@TIM#SYSTEM",
        GRP_PRIVATE: "Private",
        GRP_PUBLIC: "Public",
        GRP_CHATROOM: "ChatRoom",
        GRP_AVCHATROOM: "AVChatRoom",
        GRP_MBR_ROLE_OWNER: "Owner",
        GRP_MBR_ROLE_ADMIN: "Admin",
        GRP_MBR_ROLE_MEMBER: "Member",
        GRP_TIP_MBR_JOIN: 1,
        GRP_TIP_MBR_QUIT: 2,
        GRP_TIP_MBR_KICKED_OUT: 3,
        GRP_TIP_MBR_SET_ADMIN: 4,
        GRP_TIP_MBR_CANCELED_ADMIN: 5,
        GRP_TIP_GRP_PROFILE_UPDATED: 6,
        GRP_TIP_MBR_PROFILE_UPDATED: 7,
        MSG_REMIND_ACPT_AND_NOTE: "AcceptAndNotify",
        MSG_REMIND_ACPT_NOT_NOTE: "AcceptNotNotify",
        MSG_REMIND_DISCARD: "Discard",
        GENDER_UNKNOWN: "Gender_Type_Unknown",
        GENDER_FEMALE: "Gender_Type_Female",
        GENDER_MALE: "Gender_Type_Male",
        KICKED_OUT_MULT_ACCOUNT: "mutipleAccount",
        KICKED_OUT_MULT_DEVICE: "mutipleDevice",
        ALLOW_TYPE_ALLOW_ANY: "AllowType_Type_AllowAny",
        ALLOW_TYPE_NEED_CONFIRM: "AllowType_Type_NeedConfirm",
        ALLOW_TYPE_DENY_ANY: "AllowType_Type_DenyAny",
        FORBID_TYPE_NONE: "AdminForbid_Type_None",
        FORBID_TYPE_SEND_OUT: "AdminForbid_Type_SendOut",
        JOIN_OPTIONS_FREE_ACCESS: "FreeAccess",
        JOIN_OPTIONS_NEED_PERMISSION: "NeedPermission",
        JOIN_OPTIONS_DISABLE_APPLY: "DisableApply",
        JOIN_STATUS_SUCCESS: "JoinedSuccess",
        JOIN_STATUS_ALREADY_IN_GROUP: "AlreadyInGroup",
        JOIN_STATUS_WAIT_APPROVAL: "WaitAdminApproval",
        GRP_PROFILE_OWNER_ID: "ownerID",
        GRP_PROFILE_CREATE_TIME: "createTime",
        GRP_PROFILE_LAST_INFO_TIME: "lastInfoTime",
        GRP_PROFILE_MEMBER_NUM: "memberNum",
        GRP_PROFILE_MAX_MEMBER_NUM: "maxMemberNum",
        GRP_PROFILE_JOIN_OPTION: "joinOption",
        GRP_PROFILE_INTRODUCTION: "introduction",
        GRP_PROFILE_NOTIFICATION: "notification"
    };
    function s(e) {
        return (s = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function(e) {
            return void 0 === e ? "undefined" : _typeof(e);
        } : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : void 0 === e ? "undefined" : _typeof(e);
        })(e);
    }
    function a(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
    }
    function o(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || 0, r.configurable = 1, "value" in r && (r.writable = 1), 
            Object.defineProperty(e, r.key, r);
        }
    }
    function i(e, t, n) {
        return t && o(e.prototype, t), n && o(e, n), e;
    }
    function t(t, e) {
        var n = Object.keys(t);
        if (Object.getOwnPropertySymbols) {
            var r = Object.getOwnPropertySymbols(t);
            e && (r = r.filter(function(e) {
                return Object.getOwnPropertyDescriptor(t, e).enumerable;
            })), n.push.apply(n, r);
        }
        return n;
    }
    function H(o) {
        for (var e = 1; e < arguments.length; e++) {
            var i = null != arguments[e] ? arguments[e] : {};
            e % 2 ? t(i, 1).forEach(function(e) {
                var t, n, r;
                t = o, r = i[n = e], n in t ? Object.defineProperty(t, n, {
                    value: r,
                    enumerable: 1,
                    configurable: 1,
                    writable: 1
                }) : t[n] = r;
            }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(i)) : t(i).forEach(function(e) {
                Object.defineProperty(o, e, Object.getOwnPropertyDescriptor(i, e));
            });
        }
        return o;
    }
    function u(e, t) {
        if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
        e.prototype = Object.create(t && t.prototype, {
            constructor: {
                value: e,
                writable: 1,
                configurable: 1
            }
        }), t && p(e, t);
    }
    function c(e) {
        return (c = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
            return e.__proto__ || Object.getPrototypeOf(e);
        })(e);
    }
    function p(e, t) {
        return (p = Object.setPrototypeOf || function(e, t) {
            return e.__proto__ = t, e;
        })(e, t);
    }
    function h(e, t, n) {
        return (h = function() {
            if ("undefined" == typeof Reflect || !Reflect.construct) return 0;
            if (Reflect.construct.sham) return 0;
            if ("function" == typeof Proxy) return 1;
            try {
                return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), 
                1;
            } catch (e) {
                return 0;
            }
        }() ? Reflect.construct : function(e, t, n) {
            var r = [ null ];
            r.push.apply(r, t);
            var o = new (Function.bind.apply(e, r))();
            return n && p(o, n.prototype), o;
        }).apply(null, arguments);
    }
    function f(e) {
        if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e;
    }
    function g(e, t) {
        return !t || "object" != (void 0 === t ? "undefined" : _typeof(t)) && "function" != typeof t ? f(e) : t;
    }
    function d(e, t) {
        return function(e) {
            if (Array.isArray(e)) return e;
        }(e) || function(e, t) {
            var n = [], r = 1, o = 0, i = void 0;
            try {
                for (var s, a = e[Symbol.iterator](); !(r = (s = a.next()).done) && (n.push(s.value), 
                !t || n.length !== t); r = 1) ;
            } catch (e) {
                o = 1, i = e;
            } finally {
                try {
                    r || null == a.return || a.return();
                } finally {
                    if (o) throw i;
                }
            }
            return n;
        }(e, t) || function() {
            throw new TypeError("Invalid attempt to destructure non-iterable instance");
        }();
    }
    function m(e) {
        return function(e) {
            if (Array.isArray(e)) {
                for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t];
                return n;
            }
        }(e) || function(e) {
            if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e);
        }(e) || function() {
            throw new TypeError("Invalid attempt to spread non-iterable instance");
        }();
    }
    var y = function() {
        function e() {
            a(this, e), this.cache = [], this.options = null;
        }
        return i(e, [ {
            key: "use",
            value: function(e) {
                if ("function" != typeof e) throw "middleware must be a function";
                return this.cache.push(e), this;
            }
        }, {
            key: "next",
            value: function(e) {
                if (this.middlewares && 0 < this.middlewares.length) return this.middlewares.shift().call(this, this.options, this.next.bind(this));
            }
        }, {
            key: "run",
            value: function(e) {
                return this.middlewares = this.cache.map(function(e) {
                    return e;
                }), this.options = e, this.next();
            }
        } ]), e;
    }(), I = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
    function e(e, t) {
        return e(t = {
            exports: {}
        }, t.exports), t.exports;
    }
    var n, v, _, C, M, D, S, k = e(function(e, t) {
        var o, i, n, s, a, u, c, l, r, p, h, f, g, d, m, y, v, _;
        e.exports = (o = "function" == typeof Promise, i = "object" == ("undefined" == typeof self ? "undefined" : _typeof(self)) ? self : I, 
        n = "undefined" != typeof Symbol, s = "undefined" != typeof Map, a = "undefined" != typeof Set, 
        u = "undefined" != typeof WeakMap, c = "undefined" != typeof WeakSet, l = "undefined" != typeof DataView, 
        r = n && void 0 !== Symbol.iterator, p = n && void 0 !== Symbol.toStringTag, h = a && "function" == typeof Set.prototype.entries, 
        f = s && "function" == typeof Map.prototype.entries, g = h && Object.getPrototypeOf(new Set().entries()), 
        d = f && Object.getPrototypeOf(new Map().entries()), m = r && "function" == typeof Array.prototype[Symbol.iterator], 
        y = m && Object.getPrototypeOf([][Symbol.iterator]()), v = r && "function" == typeof String.prototype[Symbol.iterator], 
        _ = v && Object.getPrototypeOf(""[Symbol.iterator]()), 8, -1, function(e) {
            var t = void 0 === e ? "undefined" : _typeof(e);
            if ("object" !== t) return t;
            if (null === e) return "null";
            if (e === i) return "global";
            if (Array.isArray(e) && (0 == p || !(Symbol.toStringTag in e))) return "Array";
            if ("object" == ("undefined" == typeof window ? "undefined" : _typeof(window)) && null !== window) {
                if ("object" == _typeof(window.location) && e === window.location) return "Location";
                if ("object" == _typeof(window.document) && e === window.document) return "Document";
                if ("object" == _typeof(window.navigator)) {
                    if ("object" == _typeof(window.navigator.mimeTypes) && e === window.navigator.mimeTypes) return "MimeTypeArray";
                    if ("object" == _typeof(window.navigator.plugins) && e === window.navigator.plugins) return "PluginArray";
                }
                if (("function" == typeof window.HTMLElement || "object" == _typeof(window.HTMLElement)) && e instanceof window.HTMLElement) {
                    if ("BLOCKQUOTE" === e.tagName) return "HTMLQuoteElement";
                    if ("TD" === e.tagName) return "HTMLTableDataCellElement";
                    if ("TH" === e.tagName) return "HTMLTableHeaderCellElement";
                }
            }
            var n = p && e[Symbol.toStringTag];
            if ("string" == typeof n) return n;
            var r = Object.getPrototypeOf(e);
            return r === RegExp.prototype ? "RegExp" : r === Date.prototype ? "Date" : o && r === Promise.prototype ? "Promise" : a && r === Set.prototype ? "Set" : s && r === Map.prototype ? "Map" : c && r === WeakSet.prototype ? "WeakSet" : u && r === WeakMap.prototype ? "WeakMap" : l && r === DataView.prototype ? "DataView" : s && r === d ? "Map Iterator" : a && r === g ? "Set Iterator" : m && r === y ? "Array Iterator" : v && r === _ ? "String Iterator" : null === r ? "Object" : Object.prototype.toString.call(e).slice(8, -1);
        });
    }), T = "undefined" != typeof window, E = "undefined" != typeof wx && "function" == typeof wx.getSystemInfoSync && "function" == typeof wx.canIUse, A = T && window.navigator && window.navigator.userAgent || "", w = /AppleWebKit\/([\d.]+)/i.exec(A), L = (w && parseFloat(w.pop()), 
    /iPad/i.test(A), /iPhone/i.test(A), /iPod/i.test(A), (n = A.match(/OS (\d+)_/i)) && n[1] && n[1], 
    /Android/i.test(A)), R = (function() {
        var e = A.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
        if (!e) return;
        var t = e[1] && parseFloat(e[1]), n = e[2] && parseFloat(e[2]);
        t && n && parseFloat(e[1] + "." + e[2]);
    }(), !(L && /webkit/i.test(A), /Firefox/i.test(A), /Edge/i.test(A)) && /Chrome/i.test(A), 
    (S = A.match(/Chrome\/(\d+)/)) && S[1] && parseFloat(S[1]), /MSIE/.test(A)), P = (/MSIE\s8\.0/.test(A), 
    M = /MSIE\s(\d+)\.\d/.exec(A), !(D = M && parseFloat(M[1])) && /Trident\/7.0/i.test(A) && /rv:11.0/.test(A) && (D = 11), 
    D), O = (/Safari/i.test(A), /TBS\/\d+/i.test(A)), b = ((C = A.match(/TBS\/(\d+)/i)) && C[1] && C[1], 
    !O && /MQQBrowser\/\d+/i.test(A), !O && / QQBrowser\/\d+/i.test(A), /(micromessenger|webbrowser)/i.test(A)), N = (/Windows/i.test(A), 
    /MAC OS X/i.test(A), /MicroMessenger/i.test(A), "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {});
    v = "undefined" != typeof console ? console : void 0 !== N && N.console ? N.console : "undefined" != typeof window && window.console ? window.console : {};
    for (var G = function() {}, U = [ "assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn" ], q = U.length; q--; ) _ = U[q], 
    console[_] || (v[_] = G);
    v.methods = U;
    var x = v, F = 0, j = function() {
        if (E) {
            var e = wx.getSystemInfoSync().SDKVersion;
            if (void 0 === e || void 0 === wx.getLogManager) return 0;
            if (0 <= function(e, t) {
                e = e.split("."), t = t.split(".");
                for (var n = Math.max(e.length, t.length); e.length < n; ) e.push("0");
                for (;t.length < n; ) t.push("0");
                for (var r = 0; r < n; r++) {
                    var o = parseInt(e[r]), i = parseInt(t[r]);
                    if (i < o) return 1;
                    if (o < i) return -1;
                }
                return 0;
            }(e, "2.1.0")) return wx.getLogManager().log("I can use wx log. SDKVersion=" + e), 
            1;
        }
        return 0;
    }(), V = new Map();
    function K() {
        var e = new Date();
        return "TIM " + e.toLocaleTimeString("en-US", {
            hour12: 0
        }) + "." + function(e) {
            var t;
            switch (e.toString().length) {
              case 1:
                t = "00" + e;
                break;

              case 2:
                t = "0" + e;
                break;

              default:
                t = e;
            }
            return t;
        }(e.getMilliseconds()) + ":";
    }
    var $ = {
        _data: [],
        _length: 0,
        _visible: 0,
        arguments2String: function(e) {
            var t;
            if (1 === e.length) t = K() + e[0]; else {
                t = K();
                for (var n = 0, r = e.length; n < r; n++) ne(e[n]) ? oe(e[n]) ? t += le(e[n]) : t += JSON.stringify(e[n]) : t += e[n], 
                t += " ";
            }
            return t;
        },
        debug: function() {
            if (F <= -1) {
                var e = this.arguments2String(arguments);
                $.record(e, "debug"), x.debug(e), j && wx.getLogManager().debug(e);
            }
        },
        log: function() {
            if (F <= 0) {
                var e = this.arguments2String(arguments);
                $.record(e, "log"), x.log(e), j && wx.getLogManager().log(e);
            }
        },
        info: function() {
            if (F <= 1) {
                var e = this.arguments2String(arguments);
                $.record(e, "info"), x.info(e), j && wx.getLogManager().info(e);
            }
        },
        warn: function() {
            if (F <= 2) {
                var e = this.arguments2String(arguments);
                $.record(e, "warn"), x.warn(e), j && wx.getLogManager().warn(e);
            }
        },
        error: function() {
            if (F <= 3) {
                var e = this.arguments2String(arguments);
                $.record(e, "error"), x.error(e), j && wx.getLogManager().warn(e);
            }
        },
        time: function(e) {
            V.set(e, ue.now());
        },
        timeEnd: function(e) {
            if (V.has(e)) {
                var t = ue.now() - V.get(e);
                return V.delete(e), t;
            }
            return x.warn("未找到对应label: ".concat(e, ", 请在调用 logger.timeEnd 前，调用 logger.time")), 
            0;
        },
        setLevel: function(e) {
            e < 4 && x.log(K() + "set level from " + F + " to " + e), F = e;
        },
        record: function(e, t) {
            j || (1100 === $._length && ($._data.splice(0, 100), $._length = 1e3), $._length++, 
            $._data.push("".concat(e, " [").concat(t, "] \n")));
        },
        getLog: function() {
            return $._data;
        }
    }, z = function(e) {
        return "map" === ie(e);
    }, Y = function(e) {
        return "set" === ie(e);
    }, W = function(e) {
        return "file" === ie(e);
    }, X = function(e) {
        return null !== e && ("number" == typeof e && !isNaN(e - 0) || "object" === s(e) && e.constructor === Number);
    }, J = function(e) {
        return "string" == typeof e;
    }, Q = function(e) {
        return null !== e && "object" === s(e);
    }, Z = function(e) {
        if ("object" !== s(e) || null === e) return 0;
        var t = Object.getPrototypeOf(e);
        if (null === t) return 1;
        for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n);
        return t === n;
    }, ee = function(e) {
        return "function" == typeof Array.isArray ? Array.isArray(e) : "array" === ie(e);
    }, te = function(e) {
        return void 0 === e;
    }, ne = function(e) {
        return ee(e) || Q(e);
    }, re = function(e) {
        return "function" == typeof e;
    }, oe = function(e) {
        return e instanceof Error;
    }, ie = function(e) {
        return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();
    }, se = function(e) {
        if ("string" != typeof e) return 0;
        var t = e[0];
        return /[^a-zA-Z0-9]/.test(t) ? 0 : 1;
    }, ae = 0;
    Date.now || (Date.now = function() {
        return new Date().getTime();
    });
    var ue = {
        now: function() {
            0 === ae && (ae = Date.now() - 1);
            var e = Date.now() - ae;
            return 4294967295 < e ? (ae += 4294967295, Date.now() - ae) : e;
        },
        utc: function() {
            return Math.round(Date.now() / 1e3);
        }
    }, ce = function e(t, n, r, o) {
        if (!ne(t) || !ne(n)) return 0;
        for (var i, s = 0, a = Object.keys(n), u = 0, c = a.length; u < c; u++) if (i = a[u], 
        !(te(n[i]) || r && r.includes(i))) if (ne(t[i]) && ne(n[i])) s += e(t[i], n[i], r, o); else {
            if (o && o.includes(n[i])) continue;
            t[i] !== n[i] && (t[i] = n[i], s += 1);
        }
        return s;
    }, le = function(e) {
        return JSON.stringify(e, [ "message", "code" ]);
    }, pe = function() {
        var e, t = new Date(), n = t.toISOString(), r = t.getTimezoneOffset() / 60;
        return e = r < 0 ? -10 < r ? "+0" + Math.abs(100 * r) : "+" + Math.abs(100 * r) : 10 <= r ? "-" + 100 * r : "-0" + 100 * r, 
        n.replace("Z", e);
    }, he = function(e) {
        if (0 === e.length) return 0;
        for (var t = 0, n = 0, r = "undefined" != typeof document && void 0 !== document.characterSet ? document.characterSet : "UTF-8"; void 0 !== e[t]; ) n += e[t++].charCodeAt[t] <= 255 ? 1 : 0 == r ? 3 : 2;
        return n;
    }, fe = function(e) {
        var t = e || 99999999;
        return Math.round(Math.random() * t);
    }, ge = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", de = ge.length, me = function(e, t) {
        for (var n in e) if (e[n] === t) return 1;
        return 0;
    }, ye = {}, ve = function() {
        if (E) return "https:";
        var e = window.location.protocol;
        return [ "http:", "https:" ].indexOf(e) < 0 && (e = "http:"), e;
    }, _e = function(e) {
        return -1 === e.indexOf("http://") || -1 === e.indexOf("https://") ? "https://" + e : e.replace(/https|http/, "https");
    }, Ie = function(e) {
        return e === B.GRP_PUBLIC;
    }, Ce = function(e) {
        return e === B.GRP_AVCHATROOM;
    };
    function Me(t, n) {
        var r = {};
        return Object.keys(t).forEach(function(e) {
            r[e] = n(t[e], e);
        }), r;
    }
    function De(e, t) {
        return "function" != typeof e ? ($.warn("callbackSafetyDefense: The callback must be a function"), 
        e) : function() {
            try {
                e.apply(t, arguments);
            } catch (e) {
                console.error(e);
            }
        };
    }
    var Se = Object.prototype.hasOwnProperty;
    function ke(e) {
        if (null == e) return 1;
        if ("boolean" == typeof e) return 0;
        if ("number" == typeof e) return 0 === e;
        if ("string" == typeof e) return 0 === e.length;
        if ("function" == typeof e) return 0 === e.length;
        if (Array.isArray(e)) return 0 === e.length;
        if (e instanceof Error) return "" === e.message;
        if (Z(e)) {
            for (var t in e) if (Se.call(e, t)) return 0;
            return 1;
        }
        return z(e) || Y(e) || W(e) ? 0 === e.size : 0;
    }
    function Te(e, t, n, r) {
        if (void 0 === t) return 1;
        var o = 1;
        return t.required && ke(e) && (x.error("TIM [".concat(n, '] Missing required params: "').concat(r, '".')), 
        o = 0), ke(e) || k(e).toLowerCase() === t.type.toLowerCase() || (x.error("TIM [".concat(n, '] Invalid params: type check failed for "').concat(r, '".Expected ').concat(t.type, ".")), 
        o = 0), t.validator && !t.validator(e) && (x.error("TIM [".concat(n, "] Invalid params: custom validator check failed for params.")), 
        o = 0), o;
    }
    var Ee = {
        login: {
            userID: {
                type: "String",
                required: 1
            },
            userSig: {
                type: "String",
                required: 1
            }
        },
        addToBlacklist: {
            userIDList: {
                type: "Array",
                required: 1
            }
        },
        mutilParam: [ {
            name: "paramName",
            type: "Number",
            required: 1
        }, {
            name: "paramName",
            type: "String",
            required: 1
        } ],
        on: [ {
            name: "eventName",
            type: "String",
            context: "Object",
            required: 1
        }, {
            name: "listener",
            type: "Function",
            required: 0
        } ],
        sendMessage: [ {
            name: "message",
            type: "Object",
            required: 1
        } ],
        getMessageList: {
            conversationID: {
                type: "String",
                required: 1
            },
            nextReqMessageID: {
                type: "String"
            },
            count: {
                type: "Number",
                validator: function(e) {
                    return te(e) || /^[1-9][0-9]*$/.test(e) ? 1 : (console.warn("getMessageList 接口的 count 参数必须为正整数"), 
                    0);
                }
            }
        },
        getConversationProfile: [ {
            name: "conversationID",
            type: "String",
            required: 1,
            validator: function(e) {
                return e ? J(r = e) && r.slice(0, 3) === B.CONV_C2C || J(n = e) && n.slice(0, 5) === B.CONV_GROUP || J(t = e) && t === B.CONV_SYSTEM ? 1 : (console.warn("非法的会话 ID:".concat(e, "。会话 ID 组成方式：\n      C2C + userID（单聊）\n      GROUP + groupID（群聊）\n      @TIM#SYSTEM（系统通知会话）")), 
                0) : 0;
                var t, n, r;
            }
        } ],
        deleteConversation: [ {
            name: "conversationID",
            type: "String",
            required: 1
        } ],
        getGroupList: {
            groupProfileFilter: {
                type: "Array"
            }
        },
        getGroupProfile: {
            groupID: {
                type: "String",
                required: 1
            },
            groupCustomFieldFilter: {
                type: "Array"
            },
            memberCustomFieldFilter: {
                type: "Array"
            }
        },
        getGroupProfileAdvance: {
            groupIDList: {
                type: "Array",
                required: 1
            }
        },
        createGroup: {
            name: {
                type: "String",
                required: 1
            }
        },
        joinGroup: {
            groupID: {
                type: "String",
                required: 1
            },
            type: {
                type: "String"
            },
            applyMessage: {
                type: "String"
            }
        },
        quitGroup: [ {
            name: "groupID",
            type: "String",
            required: 1
        } ],
        handleApplication: {
            message: {
                type: "Object",
                required: 1
            },
            handleAction: {
                type: "String",
                required: 1
            },
            handleMessage: {
                type: "String"
            }
        },
        changeGroupOwner: {
            groupID: {
                type: "String",
                required: 1
            },
            newOwnerID: {
                type: "String",
                required: 1
            }
        },
        updateGroupProfile: {
            groupID: {
                type: "String",
                required: 1
            }
        },
        dismissGroup: [ {
            name: "groupID",
            type: "String",
            required: 1
        } ],
        searchGroupByID: [ {
            name: "groupID",
            type: "String",
            required: 1
        } ],
        getGroupMemberList: {
            groupID: {
                type: "String",
                required: 1
            },
            offset: {
                type: "Number"
            },
            count: {
                type: "Number"
            }
        },
        getGroupMemberProfile: {
            groupID: {
                type: "String",
                required: 1
            },
            userIDList: {
                type: "Array",
                required: 1
            },
            memberCustomFieldFilter: {
                type: "Array"
            }
        },
        addGroupMemeber: {
            groupID: {
                type: "String",
                required: 1
            },
            userIDList: {
                type: "Array",
                required: 1
            }
        },
        setGroupMemberRole: {
            groupID: {
                type: "String",
                required: 1
            },
            userID: {
                type: "String",
                required: 1
            },
            role: {
                type: "String",
                required: 1
            }
        },
        setGroupMemberMuteTime: {
            groupID: {
                type: "String",
                required: 1
            },
            userID: {
                type: "String"
            },
            muteTime: {
                type: "Number",
                validator: function(e) {
                    return 0 <= e;
                }
            }
        },
        setGroupMemberNameCard: {
            groupID: {
                type: "String",
                required: 1
            },
            userID: {
                type: "String"
            },
            nameCard: {
                type: "String",
                required: 1,
                validator: function(e) {
                    return 1 == /^\s+$/.test(e) ? 0 : 1;
                }
            }
        },
        setMessageRemindType: {
            groupID: {
                type: "String",
                required: 1
            },
            messageRemindType: {
                type: "String",
                required: 1
            }
        },
        setGroupMemberCustomField: {
            groupID: {
                type: "String",
                required: 1
            },
            userID: {
                type: "String"
            },
            memberCustomField: {
                type: "Array",
                required: 1
            }
        },
        deleteGroupMember: {
            groupID: {
                type: "String",
                required: 1
            }
        },
        createTextMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        },
        createCustomMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        },
        createImageMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        },
        createAudioMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        },
        createVideoMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        },
        createFaceMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1,
                validator: function(e) {
                    return Z(e) ? X(e.index) ? J(e.data) ? 1 : (console.warn("createFaceMessage payload.data 类型必须为 String！"), 
                    0) : (console.warn("createFaceMessage payload.index 类型必须为 Number！"), 0) : 0;
                }
            }
        },
        createFileMessage: {
            to: {
                type: "String",
                required: 1
            },
            conversationType: {
                type: "String",
                required: 1
            },
            payload: {
                type: "Object",
                required: 1
            }
        }
    }, Ae = {
        login: "login",
        logout: "logout",
        on: "on",
        once: "once",
        off: "off",
        setLogLevel: "setLogLevel",
        downloadLog: "downloadLog",
        registerPlugin: "registerPlugin",
        destroy: "destroy",
        createTextMessage: "createTextMessage",
        createImageMessage: "createImageMessage",
        createAudioMessage: "createAudioMessage",
        createVideoMessage: "createVideoMessage",
        createCustomMessage: "createCustomMessage",
        createFaceMessage: "createFaceMessage",
        createFileMessage: "createFileMessage",
        sendMessage: "sendMessage",
        resendMessage: "resendMessage",
        getMessageList: "getMessageList",
        setMessageRead: "setMessageRead",
        getConversationList: "getConversationList",
        getConversationProfile: "getConversationProfile",
        deleteConversation: "deleteConversation",
        getGroupList: "getGroupList",
        getGroupProfile: "getGroupProfile",
        createGroup: "createGroup",
        joinGroup: "joinGroup",
        updateGroupProfile: "updateGroupProfile",
        quitGroup: "quitGroup",
        dismissGroup: "dismissGroup",
        changeGroupOwner: "changeGroupOwner",
        searchGroupByID: "searchGroupByID",
        setMessageRemindType: "setMessageRemindType",
        handleGroupApplication: "handleGroupApplication",
        getGroupMemberProfile: "getGroupMemberProfile",
        getGroupMemberList: "getGroupMemberList",
        addGroupMember: "addGroupMember",
        deleteGroupMember: "deleteGroupMember",
        setGroupMemberNameCard: "setGroupMemberNameCard",
        setGroupMemberMuteTime: "setGroupMemberMuteTime",
        setGroupMemberRole: "setGroupMemberRole",
        setGroupMemberCustomField: "setGroupMemberCustomField",
        getMyProfile: "getMyProfile",
        getUserProfile: "getUserProfile",
        updateMyProfile: "updateMyProfile",
        getBlacklist: "getBlacklist",
        addToBlacklist: "addToBlacklist",
        removeFromBlacklist: "removeFromBlacklist",
        getFriendList: "getFriendList"
    }, we = 2e3, Le = 2001, Re = 2002, Pe = 2003, Oe = 2004, be = 2022, Ne = 2023, Ge = 2040, Ue = 2100, qe = 2101, xe = 2103, Fe = 2105, Be = 2106, He = 2108, je = 2109, Ve = 2251, Ke = 2252, $e = 2253, ze = 2300, Ye = 2301, We = 2350, Xe = 2351, Je = 2352, Qe = 2400, Ze = 2401, et = 2402, tt = 2403, nt = 2500, rt = 2501, ot = 2502, it = 2600, st = 2601, at = 2620, ut = 2621, ct = 2622, lt = 2660, pt = 2661, ht = 2680, ft = 2681, gt = 2682, dt = 2683, mt = 2684, yt = 2700, vt = 2720, _t = 2721, It = 2740, Ct = 2741, Mt = 2742, Dt = 2800, St = 2801, kt = 2802, Tt = 2803, Et = 2804, At = 2805, wt = 2900, Lt = 2901, Rt = 2902, Pt = 2903, Ot = 2999, bt = 91101, Nt = "无 SDKAppID", Gt = "无 accountType", Ut = "无 userID", qt = "无 usersig", xt = "无 SDK 实例", Ft = "无tinyid", Bt = "无a2key", Ht = "未检测到 COS 上传插件", jt = "消息发送失败", Vt = "未知的漫游消息结束字段", Kt = "MessageController.constructor() 需要参数 options", $t = "需要 Message 的实例", zt = 'Message.conversationType 只能为 "C2C"或"GROUP" ', Yt = "无法发送空文件", Wt = "回调函数运行时遇到错误，请检查接入侧代码", Xt = "请先选择一个图片", Jt = "只允许上传 jpg png jpeg gif 格式的图片", Qt = "图片大小超过20M，无法发送", Zt = "语音上传失败", en = "语音大小大于20M，无法发送", tn = "视频上传失败", nn = "视频大小超过20M，无法发送", rn = "只允许上传 mp4 格式的视频", on = "文件上传失败", sn = "请先选择一个文件", an = "文件大小超过20M，无法发送 ", un = "缺少必要的参数文件 URL", cn = "没有找到相应的会话，请检查传入参数", ln = "没有找到相应的用户或群组，请检查传入参数", pn = "未记录的会话类型", hn = "非法的群类型，请检查传入参数", fn = "不能加入 Private 类型的群组", gn = "AVChatRoom 类型的群组不能转让群主", dn = "不能把群主转让给自己", mn = "不能解散 Private 类型的群组", yn = "加群失败，请检查传入参数或重试", vn = "AVChatRoom 类型的群不支持邀请群成员", _n = "不能在 AVChatRoom 类型的群组踢人", In = "你不是群主，只有群主才有权限操作", Cn = "不能在 Private / AVChatRoom 类型的群中设置群成员身份", Mn = "不合法的群成员身份，请检查传入参数", Dn = "不能设置自己的群成员身份，请检查传入参数", Sn = "传入 deleteFriend 接口的参数无效", kn = "传入 getUserProfile 接口的参数无效", Tn = "传入 updateMyProfile 接口的参数无效", En = "传入 addToBlacklist 接口的参数无效", An = "传入 removeFromBlacklist 接口的参数无效", wn = "不能拉黑自己", Ln = "网络层初始化错误，缺少 URL 参数", Rn = "打包错误，未定义的 serverName", Pn = "未定义的 packageConfig", On = "未连接到网络", bn = "意料外的通知条件", Nn = "_syncOffset 丢失", Gn = "接口调用时机不合理，等待 SDK 处于 ready 状态后再调用（监听 TIM.EVENT.SDK_READY 事件）", Un = {
        70001: "UserSig 已过期，请重新生成。建议 UserSig 有效期设置不小于24小时。",
        70002: "UserSig 长度为0，请检查传入的 UserSig 是否正确。",
        70003: "UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。",
        70005: "UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。",
        70009: "UserSig 验证失败，可能因为生成 UserSig 时混用了其他 SDKAppID 的私钥或密钥导致，请使用对应 SDKAppID 下的私钥或密钥重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。",
        70013: "请求中的 UserID 与生成 UserSig 时使用的 UserID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。",
        70014: "请求中的 SDKAppID 与生成 UserSig 时使用的 SDKAppID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。",
        70016: "公钥不存在，UserSig 验证失败，请在即时通信 IM 控制台获取密钥(https://cloud.tencent.com/document/product/269/32578#.E8.8E.B7.E5.8F.96.E5.AF.86.E9.92.A5)。",
        70020: "SDKAppID 未找到，请在即时通信 IM 控制台确认应用信息。",
        70050: "UserSig 验证次数过于频繁。请检查 UserSig 是否正确，并于1分钟后重新验证。您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。",
        70051: "帐号被拉入黑名单。",
        70052: "UserSig 已经失效，请重新生成，再次尝试。",
        70107: "因安全原因被限制登录，请不要频繁登录。",
        70169: "请求的用户帐号不存在。",
        70114: "服务端内部超时，请稍后重试。",
        70202: "服务端内部超时，请稍后重试。",
        70206: "请求中批量数量不合法。",
        70402: "参数非法，请检查必填字段是否填充，或者字段的填充是否满足协议要求。",
        70403: "请求失败，需要 App 管理员权限。",
        70398: "帐号数超限。如需创建多于100个帐号，请将应用升级为专业版，具体操作指引请参见购买指引(https://cloud.tencent.com/document/product/269/32458)。",
        70500: "服务端内部错误，请稍后重试。",
        71000: "删除帐号失败。仅支持删除体验版帐号，您当前应用为专业版，暂不支持帐号删除。",
        20001: "请求包非法。",
        20002: "UserSig 或 A2 失效。",
        20003: "消息发送方或接收方 UserID 无效或不存在，请检查 UserID 是否已导入即时通信 IM。",
        20004: "网络异常，请重试。",
        20005: "服务端内部错误，请重试。",
        20006: "触发发送单聊消息之前回调，App 后台返回禁止下发该消息。",
        20007: "发送单聊消息，被对方拉黑，禁止发送。消息发送状态默认展示为失败，您可以登录控制台修改该场景下的消息发送状态展示结果，具体操作请参见消息保留设置(https://cloud.tencent.com/document/product/269/38656)。",
        20009: "消息发送双方互相不是好友，禁止发送（配置单聊消息校验好友关系才会出现）。",
        20010: "发送单聊消息，自己不是对方的好友（单向关系），禁止发送。",
        20011: "发送单聊消息，对方不是自己的好友（单向关系），禁止发送。",
        20012: "发送方被禁言，该条消息被禁止发送。",
        20016: "消息撤回超过了时间限制（默认2分钟）。",
        20018: "删除漫游内部错误。",
        90001: "JSON 格式解析失败，请检查请求包是否符合 JSON 规范。",
        90002: "JSON 格式请求包中 MsgBody 不符合消息格式描述，或者 MsgBody 不是 Array 类型，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。",
        90003: "JSON 格式请求包体中缺少 To_Account 字段或者 To_Account 帐号不存在。",
        90005: "JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型。",
        90006: "JSON 格式请求包体中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型。",
        90007: "JSON 格式请求包体中 MsgBody 类型不是 Array 类型，请将其修改为 Array 类型。",
        90008: "JSON 格式请求包体中缺少 From_Account 字段或者 From_Account 帐号不存在。",
        90009: "请求需要 App 管理员权限。",
        90010: "JSON 格式请求包不符合消息格式描述，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。",
        90011: "批量发消息目标帐号超过500，请减少 To_Account 中目标帐号数量。",
        90012: "To_Account 没有注册或不存在，请确认 To_Account 是否导入即时通信 IM 或者是否拼写错误。",
        90026: "消息离线存储时间错误（最多不能超过7天）。",
        90031: "JSON 格式请求包体中 SyncOtherMachine 字段不是 Integer 类型。",
        90044: "JSON 格式请求包体中 MsgLifeTime 字段不是 Integer 类型。",
        90048: "请求的用户帐号不存在。",
        90054: "撤回请求中的 MsgKey 不合法。",
        90994: "服务内部错误，请重试。",
        90995: "服务内部错误，请重试。",
        91000: "服务内部错误，请重试。",
        90992: "服务内部错误，请重试；如果所有请求都返回该错误码，且 App 配置了第三方回调，请检查 App 服务端是否正常向即时通信 IM 后台服务端返回回调结果。",
        93000: "JSON 数据包超长，消息包体请不要超过8k。",
        91101: "Web 端长轮询被踢（Web 端同时在线实例个数超出限制）。",
        10002: "服务端内部错误，请重试。",
        10003: "请求中的接口名称错误，请核对接口名称并重试。",
        10004: "参数非法，请根据错误描述检查请求是否正确。",
        10005: "请求包体中携带的帐号数量过多。",
        10006: "操作频率限制，请尝试降低调用的频率。",
        10007: "操作权限不足，例如 Public 群组中普通成员尝试执行踢人操作，但只有 App 管理员才有权限。",
        10008: "请求非法，可能是请求中携带的签名信息验证不正确，请再次尝试。",
        10009: "该群不允许群主主动退出。",
        10010: "群组不存在，或者曾经存在过，但是目前已经被解散。",
        10011: "解析 JSON 包体失败，请检查包体的格式是否符合 JSON 格式。",
        10012: "发起操作的 UserID 非法，请检查发起操作的用户 UserID 是否填写正确。",
        10013: "被邀请加入的用户已经是群成员。",
        10014: "群已满员，无法将请求中的用户加入群组，如果是批量加人，可以尝试减少加入用户的数量。",
        10015: "群组 ID 非法，请检查群组 ID 是否填写正确。",
        10016: "App 后台通过第三方回调拒绝本次操作。",
        10017: "因被禁言而不能发送消息，请检查发送者是否被设置禁言。",
        10018: "应答包长度超过最大包长（1MB），请求的内容过多，请尝试减少单次请求的数据量。",
        10019: "请求的用户帐号不存在。",
        10021: "群组 ID 已被使用，请选择其他的群组 ID。",
        10023: "发消息的频率超限，请延长两次发消息时间的间隔。",
        10024: "此邀请或者申请请求已经被处理。",
        10025: "群组 ID 已被使用，并且操作者为群主，可以直接使用。",
        10026: "该 SDKAppID 请求的命令字已被禁用。",
        10030: "请求撤回的消息不存在。",
        10031: "消息撤回超过了时间限制（默认2分钟）。",
        10032: "请求撤回的消息不支持撤回操作。",
        10033: "群组类型不支持消息撤回操作。",
        10034: "该消息类型不支持删除操作。",
        10035: "音视频聊天室和在线成员广播大群不支持删除消息。",
        10036: "音视频聊天室创建数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买预付费套餐“IM音视频聊天室”。",
        10037: "单个用户可创建和加入的群组数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“单人可创建与加入群组数”。",
        10038: "群成员数量超过限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“扩展群人数上限”。",
        10041: "该应用（SDKAppID）已配置不支持群消息撤回。"
    }, qn = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this))).code = e.code, t.message = Un[e.code] || e.message, 
            t.data = e.data || {}, t;
        }
        return u(n, (t = Error, r = "function" == typeof Map ? new Map() : void 0, function(e) {
            if (null === e || (t = e, -1 === Function.toString.call(t).indexOf("[native code]"))) return e;
            var t;
            if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
            if (void 0 !== r) {
                if (r.has(e)) return r.get(e);
                r.set(e, n);
            }
            function n() {
                return h(e, arguments, c(this).constructor);
            }
            return n.prototype = Object.create(e.prototype, {
                constructor: {
                    value: n,
                    enumerable: 0,
                    writable: 1,
                    configurable: 1
                }
            }), p(n, e);
        }(t))), n;
        var t, r;
    }(), xn = "1.7.3", Fn = "537048168", Bn = "10", Hn = "protobuf", jn = "json", Vn = {
        HOST: {
            TYPE: 3,
            ACCESS_LAYER_TYPES: {
                SANDBOX: 1,
                TEST: 2,
                PRODUCTION: 3
            },
            CURRENT: {
                COMMON: "https://webim.tim.qq.com",
                PIC: "https://pic.tim.qq.com",
                COS: "https://yun.tim.qq.com"
            },
            PRODUCTION: {
                COMMON: "https://webim.tim.qq.com",
                PIC: "https://pic.tim.qq.com",
                COS: "https://yun.tim.qq.com"
            },
            SANDBOX: {
                COMMON: "https://events.tim.qq.com",
                PIC: "https://pic.tim.qq.com",
                COS: "https://yun.tim.qq.com"
            },
            TEST: {
                COMMON: "https://test.tim.qq.com",
                PIC: "https://pic.tim.qq.com",
                COS: "https://yun.tim.qq.com"
            },
            setCurrent: function() {
                switch (0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 3) {
                  case this.ACCESS_LAYER_TYPES.SANDBOX:
                    this.CURRENT = this.SANDBOX, this.TYPE = this.ACCESS_LAYER_TYPES.SANDBOX;
                    break;

                  case this.ACCESS_LAYER_TYPES.TEST:
                    this.CURRENT = this.TEST, this.TYPE = this.ACCESS_LAYER_TYPES.TEST;
                    break;

                  default:
                    this.CURRENT = this.PRODUCTION, this.TYPE = this.ACCESS_LAYER_TYPES.PRODUCTION;
                }
            }
        },
        NAME: {
            OPEN_IM: "openim",
            GROUP: "group_open_http_svc",
            FRIEND: "sns",
            PROFILE: "profile",
            RECENT_CONTACT: "recentcontact",
            PIC: "openpic",
            BIG_GROUP_NO_AUTH: "group_open_http_noauth_svc",
            BIG_GROUP_LONG_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc",
            IM_OPEN_STAT: "imopenstat",
            WEB_IM: "webim",
            IM_COS_SIGN: "im_cos_sign_svr"
        },
        CMD: {
            ACCESS_LAYER: "accesslayer",
            LOGIN: "login",
            LOGOUT_LONG_POLL: "longpollinglogout",
            LOGOUT_ALL: "logout",
            PORTRAIT_GET: "portrait_get",
            PORTRAIT_SET: "portrait_set",
            GET_LONG_POLL_ID: "getlongpollingid",
            LONG_POLL: "longpolling",
            AVCHATROOM_LONG_POLL: "get_msg",
            FRIEND_ADD: "friend_add",
            FRIEND_GET_ALL: "friend_get_all",
            FRIEND_DELETE: "friend_delete",
            RESPONSE_PENDENCY: "friend_response",
            GET_PENDENCY: "pendency_get",
            DELETE_PENDENCY: "pendency_delete",
            GET_GROUP_PENDENCY: "get_pendency",
            GET_BLACKLIST: "black_list_get",
            ADD_BLACKLIST: "black_list_add",
            DELETE_BLACKLIST: "black_list_delete",
            CREATE_GROUP: "create_group",
            GET_JOINED_GROUPS: "get_joined_group_list",
            SEND_MESSAGE: "sendmsg",
            SEND_GROUP_MESSAGE: "send_group_msg",
            GET_GROUP_INFO: "get_group_info",
            GET_GROUP_MEMBER_INFO: "get_specified_group_member_info",
            GET_GROUP_MEMBER_LIST: "get_group_member_info",
            QUIT_GROUP: "quit_group",
            CHANGE_GROUP_OWNER: "change_group_owner",
            DESTROY_GROUP: "destroy_group",
            ADD_GROUP_MEMBER: "add_group_member",
            DELETE_GROUP_MEMBER: "delete_group_member",
            SEARCH_GROUP_BY_ID: "get_group_public_info",
            APPLY_JOIN_GROUP: "apply_join_group",
            HANDLE_APPLY_JOIN_GROUP: "handle_apply_join_group",
            MODIFY_GROUP_INFO: "modify_group_base_info",
            MODIFY_GROUP_MEMBER_INFO: "modify_group_member_info",
            DELETE_GROUP_SYSTEM_MESSAGE: "deletemsg",
            GET_CONVERSATION_LIST: "get",
            PAGING_GET_CONVERSATION_LIST: "page_get",
            DELETE_CONVERSATION: "delete",
            GET_MESSAGES: "getmsg",
            GET_C2C_ROAM_MESSAGES: "getroammsg",
            GET_GROUP_ROAM_MESSAGES: "group_msg_get",
            SET_C2C_MESSAGE_READ: "msgreaded",
            SET_GROUP_MESSAGE_READ: "msg_read_report",
            FILE_READ_AND_WRITE_AUTHKEY: "authkey",
            FILE_UPLOAD: "pic_up",
            COS_SIGN: "cos",
            TIM_WEB_REPORT: "tim_web_report",
            BIG_DATA_HALLWAY_AUTH_KEY: "authkey"
        },
        CHANNEL: {
            SOCKET: 1,
            XHR: 2,
            AUTO: 0
        },
        NAME_VERSION: {
            openim: "v4",
            group_open_http_svc: "v4",
            sns: "v4",
            profile: "v4",
            recentcontact: "v4",
            openpic: "v4",
            group_open_http_noauth_svc: "v1",
            group_open_long_polling_http_noauth_svc: "v1",
            imopenstat: "v4",
            im_cos_sign_svr: "v4",
            webim: "v4"
        }
    };
    Vn.HOST.setCurrent(Vn.HOST.ACCESS_LAYER_TYPES.PRODUCTION);
    var Kn = {
        request: {
            toAccount: "To_Account",
            fromAccount: "From_Account",
            to: "To_Account",
            from: "From_Account",
            groupID: "GroupId",
            avatar: "FaceUrl"
        },
        response: {
            GroupId: "groupID",
            Member_Account: "userID",
            MsgList: "messageList",
            SyncFlag: "syncFlag",
            To_Account: "to",
            From_Account: "from",
            MsgSeq: "sequence",
            MsgRandom: "random",
            MsgTimeStamp: "time",
            MsgContent: "content",
            MsgBody: "elements",
            MsgType: "type",
            MsgShow: "messageShow",
            NextMsgSeq: "nextMessageSeq",
            FaceUrl: "avatar",
            ProfileDataMod: "profileModify",
            Profile_Account: "userID",
            ValueBytes: "value",
            ValueNum: "value",
            NoticeSeq: "noticeSequence",
            NotifySeq: "notifySequence",
            MsgFrom_AccountExtraInfo: "messageFromAccountExtraInformation",
            Operator_Account: "operatorID",
            OpType: "operationType",
            ReportType: "operationType",
            UserId: "userID",
            User_Account: "userID",
            List_Account: "userIDList",
            MsgOperatorMemberExtraInfo: "operatorInfo",
            MsgMemberExtraInfo: "memberInfoList",
            ImageUrl: "avatar",
            NickName: "nick",
            MsgGroupNewInfo: "newGroupProfile",
            Owner_Account: "ownerID",
            GroupName: "name",
            GroupFaceUrl: "avatar",
            GroupIntroduction: "introduction",
            GroupNotification: "notification",
            GroupApplyJoinOption: "joinOption",
            MsgKey: "messageKey",
            GroupInfo: "groupProfile",
            Desc: "description",
            Ext: "extension"
        },
        ignoreKeyWord: [ "C2C", "ID", "USP" ]
    }, $n = "_contextWasUpdated", zn = "_contextWasReset", Yn = "_a2KeyAndTinyIDUpdated", Wn = "_noticeIsSynchronizing", Xn = "_noticeIsSynchronized", Jn = "_sendingMessage", Qn = "_sendC2CMessageSuccess", Zn = "_syncMessageProcessing", er = "_syncMessageFinished", tr = "_receiveInstantMessage", nr = "_sendGroupMessageSuccess", rr = "_receiveGroupInstantMessage", or = "_receveGroupSystemNotice", ir = "_getLongPollIDFail", sr = "_longPollStart", ar = "_longPollInArrived", ur = "_longPollInNotArrived", cr = "_longPollSoonReconnect", lr = "_longPollLongReconnect", pr = "_longpollChannelDisconnect", hr = "_longPollStopped", fr = "_longPollKickedOut", gr = "_longPollMitipuleDeviceKickedOut", dr = "_longPollGetNewC2CNotice", mr = "_longPollGetNewGroupMessages", yr = "_longPollGetNewGroupTips", vr = "_longPollGetNewGroupNotice", _r = "_longPollGetNewFriendMessages", Ir = "_longPollProfileModified", Cr = "_longPollNoticeReceiveSystemOrders", Mr = "_longpollRestart", Dr = "_onGroupListUpdated", Sr = "_login", kr = "_loginSuccess", Tr = "_signLogoutExcuting", Er = "_logoutSuccess", Ar = "_errorHasBeenDetected", wr = "_onConversationListUpdated", Lr = "_onConversationListProfileUpdated", Rr = "_conversationDeleted", Pr = "onProfileUpdated", Or = "joinAVChatRoomSuccess", br = "_sdkStateReady";
    function Nr(e, t) {
        if ("string" != typeof e && !Array.isArray(e)) throw new TypeError("Expected the input to be `string | string[]`");
        var n;
        return t = Object.assign({
            pascalCase: 0
        }, t), 0 === (e = Array.isArray(e) ? e.map(function(e) {
            return e.trim();
        }).filter(function(e) {
            return e.length;
        }).join("-") : e.trim()).length ? "" : 1 === e.length ? t.pascalCase ? e.toUpperCase() : e.toLowerCase() : (e !== e.toLowerCase() && (e = Gr(e)), 
        n = e = e.replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, function(e, t) {
            return t.toUpperCase();
        }).replace(/\d+(\w|$)/g, function(e) {
            return e.toUpperCase();
        }), t.pascalCase ? n.charAt(0).toUpperCase() + n.slice(1) : n);
    }
    var Gr = function(e) {
        for (var t = 0, n = 0, r = 0, o = 0; o < e.length; o++) {
            var i = e[o];
            t && /[a-zA-Z]/.test(i) && i.toUpperCase() === i ? (e = e.slice(0, o) + "-" + e.slice(o), 
            t = 0, r = n, n = 1, o++) : n && r && /[a-zA-Z]/.test(i) && i.toLowerCase() === i ? (e = e.slice(0, o - 1) + "-" + e.slice(o - 1), 
            r = n, n = 0, t = 1) : (t = i.toLowerCase() === i && i.toUpperCase() !== i, r = n, 
            n = i.toUpperCase() === i && i.toLowerCase() !== i);
        }
        return e;
    };
    function Ur(e, t, n) {
        var u = [], c = 0, r = function n(e, s) {
            if (10 < ++c) return c--, e;
            if (ee(e)) {
                var t = e.map(function(e) {
                    return Q(e) ? n(e, s) : e;
                });
                return c--, t;
            }
            if (Q(e)) {
                var r = (o = e, i = function(e, t) {
                    if (!se(t)) return 0;
                    if ((o = t) !== Nr(o)) {
                        for (var n = 1, r = 0; r < Kn.ignoreKeyWord.length; r++) if (t.includes(Kn.ignoreKeyWord[r])) {
                            n = 0;
                            break;
                        }
                        n && u.push(t);
                    }
                    var o, i;
                    return te(s[t]) ? (i = t)[0].toUpperCase() + Nr(i).slice(1) : s[t];
                }, a = Object.create(null), Object.keys(o).forEach(function(e) {
                    var t = i(o[e], e);
                    t && (a[t] = o[e]);
                }), a);
                return r = Me(r, function(e, t) {
                    return ee(e) || Q(e) ? n(e, s) : e;
                }), c--, r;
            }
            var o, i, a;
        }(e, t = H({}, Kn.request, {}, t));
        return 0 < u.length && n.innerEmitter.emit(Ar, {
            code: wt,
            message: wt
        }), r;
    }
    var qr = function() {
        function r(t, e) {
            var n = this;
            if (a(this, r), void 0 === e) throw new qn({
                code: Oe,
                message: xt
            });
            this.tim = e, this.method = t.method || "POST", this._initializeServerMap(), this._initializeURL(t), 
            this._initializeRequestData(t), this.callback = function(e) {
                return function t(e, n) {
                    if (n = H({}, Kn.response, {}, n), ee(e)) return e.map(function(e) {
                        return Q(e) ? t(e, n) : e;
                    });
                    if (Q(e)) {
                        var r = (o = e, i = function(e, t) {
                            return te(n[t]) ? Nr(t) : n[t];
                        }, s = {}, Object.keys(o).forEach(function(e) {
                            s[i(o[e], e)] = o[e];
                        }), s);
                        return Me(r, function(e) {
                            return ee(e) || Q(e) ? t(e, n) : e;
                        });
                    }
                    var o, i, s;
                }(e = t.decode(e), n._getResponseMap(t));
            };
        }
        return i(r, [ {
            key: "_initializeServerMap",
            value: function() {
                this._serverMap = Object.create(null);
                var e = "";
                for (var t in Vn.NAME) if (Object.prototype.hasOwnProperty.call(Vn.NAME, t)) switch (e = Vn.NAME[t]) {
                  case Vn.NAME.PIC:
                    this._serverMap[e] = Vn.HOST.CURRENT.PIC;
                    break;

                  case Vn.NAME.IM_COS_SIGN:
                    this._serverMap[e] = Vn.HOST.CURRENT.COS;
                    break;

                  default:
                    this._serverMap[e] = Vn.HOST.CURRENT.COMMON;
                }
            }
        }, {
            key: "_getHost",
            value: function(e) {
                if (void 0 !== this._serverMap[e]) return this._serverMap[e];
                throw new qn({
                    code: Tt,
                    message: Rn
                });
            }
        }, {
            key: "_initializeURL",
            value: function(e) {
                var t = e.serverName, n = e.cmd, r = this._getHost(t), o = "".concat(r, "/").concat(Vn.NAME_VERSION[t], "/").concat(t, "/").concat(n);
                o += "?".concat(this._getQueryString(e.queryString)), this.url = o;
            }
        }, {
            key: "getUrl",
            value: function() {
                return this.url.replace(/&reqtime=(\d+)/, "&reqtime=".concat(Math.ceil(+new Date() / 1e3)));
            }
        }, {
            key: "_initializeRequestData",
            value: function(e) {
                var t, n = e.requestData;
                t = this._requestDataCleaner(n), this.requestData = e.encode(t);
            }
        }, {
            key: "_requestDataCleaner",
            value: function(e) {
                var t = Array.isArray(e) ? [] : Object.create(null);
                for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && se(n) && null !== e[n] && ("object" !== s(e[n]) ? t[n] = e[n] : t[n] = this._requestDataCleaner.bind(this)(e[n]));
                return t;
            }
        }, {
            key: "_getQueryString",
            value: function(e) {
                var t = [];
                for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && ("function" != typeof e[n] ? t.push("".concat(n, "=").concat(e[n])) : t.push("".concat(n, "=").concat(e[n]())));
                return t.join("&");
            }
        }, {
            key: "_getResponseMap",
            value: function(e) {
                if (e.keyMaps && e.keyMaps.response && 0 < Object.keys(e.keyMaps.response).length) return e.keyMaps.response;
            }
        } ]), r;
    }();
    function xr(e) {
        this.mixin(e);
    }
    xr.mixin = function(e) {
        var t = e.prototype || e;
        t._isReady = 0, t.ready = function(e) {
            var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
            if (e) return this._isReady ? void (t ? e.call(this) : setTimeout(e, 1)) : (this._readyQueue = this._readyQueue || [], 
            void this._readyQueue.push(e));
        }, t.triggerReady = function() {
            var t = this;
            this._isReady = 1, setTimeout(function() {
                var e = t._readyQueue;
                t._readyQueue = [], e && 0 < e.length && e.forEach(function(e) {
                    e.call(this);
                }, t);
            }, 1);
        }, t.resetReady = function() {
            this._isReady = 0, this._readyQueue = [];
        }, t.isReady = function() {
            return this._isReady;
        };
    };
    var Fr = {
        SUCCESS: "JoinedSuccess",
        WAIT_APPROVAL: "WaitAdminApproval"
    }, Br = {
        SUCCESS: 0
    }, Hr = {
        IS_LOGIN: 1,
        IS_NOT_LOGIN: 0
    }, jr = {
        UNSEND: "unSend",
        SUCCESS: "success",
        FAIL: "fail"
    }, Vr = {
        C2C_IS_FINISHED: 1,
        C2C_IS_NOT_FINISHED: 0,
        GROUP_IS_FINISHED: 1,
        GROUP_IS_NOT_FINISHED: 0
    }, Kr = {
        SIGN_IN: 1,
        SIGN_OUT: 0
    }, $r = {
        ONLINE: 1,
        OFFLINE: 0
    }, zr = {
        NOT_START: "notStart",
        PENDING: "pengding",
        RESOLVED: "resolved",
        REJECTED: "rejected"
    }, Yr = function() {
        function t(e) {
            if (a(this, t), 0 == !!e) throw new qn({
                code: Oe,
                message: xt
            });
            xr.mixin(this), this.tim = e, this.innerEmitter = e.innerEmitter, this.connectionController = e.connectionController, 
            this.packageConfig = e.packageConfig, this.packageConfig.update(e);
        }
        return i(t, [ {
            key: "isLoggedIn",
            value: function() {
                return this.tim.context.login === Hr.IS_LOGIN;
            }
        }, {
            key: "createPackage",
            value: function(e) {
                var t = this.packageConfig.get(e);
                return t ? new qr(t, this.tim) : 0;
            }
        }, {
            key: "reset",
            value: function() {
                $.warn([ "method: IMController.reset() method must be implemented" ].join());
            }
        }, {
            key: "probeNetwork",
            value: function() {
                return this.tim.netMonitor.probe();
            }
        }, {
            key: "getNetworkType",
            value: function() {
                return this.tim.netMonitor.getNetworkType();
            }
        }, {
            key: "destroy",
            value: function() {
                $.warn("destory");
            }
        }, {
            key: "getPlatform",
            value: function() {
                var e = "web";
                return b ? e = "wechat" : E && (e = "wxmp"), e;
            }
        } ]), t;
    }(), Wr = function() {
        function n(e, t) {
            a(this, n), this.data = e, this.tim = t, this.defaultData = {}, Object.assign(this.defaultData, e), 
            this.initGetterAndSetter();
        }
        return i(n, [ {
            key: "initGetterAndSetter",
            value: function() {
                var n = this, r = this.tim, e = function(t, e) {
                    Object.defineProperty(n, t, {
                        enumerable: 1,
                        configurable: 1,
                        get: function() {
                            return n.data[t];
                        },
                        set: function(e) {
                            n.data[t] = e, n.onChange.bind(n)(r.context, t, e);
                        }
                    });
                };
                for (var t in n.data) Object.prototype.hasOwnProperty.call(n.data, t) && e(t, n.data[t]);
            }
        }, {
            key: "onChange",
            value: function(e, t, n) {
                this.tim.innerEmitter.emit($n, {
                    data: {
                        context: e,
                        key: t,
                        value: n
                    }
                });
            }
        }, {
            key: "reset",
            value: function() {
                for (var e in this.data) Object.prototype.hasOwnProperty.call(this.data, e) && (this.data[e] = this.defaultData.hasOwnProperty(e) ? this.defaultData[e] : null);
                this.tim.innerEmitter.emit(zn, {
                    data: this.tim.context
                });
            }
        } ]), n;
    }(), Xr = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initContext(), t._initListener(), 
            t;
        }
        return u(n, Yr), i(n, [ {
            key: "reset",
            value: function() {
                this.tim.context.reset();
            }
        }, {
            key: "_initListener",
            value: function() {
                this.tim.innerEmitter.on(kr, this._updateA2KeyAndTinyID, this);
            }
        }, {
            key: "_updateA2KeyAndTinyID",
            value: function(e) {
                var t = e.data, n = t.a2Key, r = t.tinyID;
                this.set("a2Key", n), this.set("tinyID", r), this.tim.innerEmitter.emit(Yn, {
                    data: {
                        context: this.tim.context
                    }
                }), this.triggerReady();
            }
        }, {
            key: "get",
            value: function(e) {
                return this.tim.context[e];
            }
        }, {
            key: "set",
            value: function(e, t) {
                this.tim.context[e] = t;
            }
        }, {
            key: "_initContext",
            value: function() {
                var e = this.tim.loginInfo;
                this.tim.context = new Wr({
                    login: Hr.IS_NOT_LOGIN,
                    SDKAppID: e.SDKAppID,
                    appIDAt3rd: null,
                    accountType: e.accountType,
                    identifier: e.identifier,
                    tinyID: null,
                    identifierNick: e.identifierNick,
                    userSig: e.userSig,
                    a2Key: null,
                    contentType: "json",
                    apn: 1
                }, this.tim), this.tim.innerEmitter.on($n, this._onContextMemberChange.bind(this));
            }
        }, {
            key: "_onContextMemberChange",
            value: function(e) {
                var t = e.data, n = t.key, r = t.value;
                switch (n) {
                  case "tinyID":
                    r.length <= 0 ? this.tim.context.login = Hr.IS_NOT_LOGIN : this.tim.context.login = null !== this.tim.context.a2Key ? Hr.IS_LOGIN : Hr.IS_NOT_LOGIN;
                    break;

                  case "a2Key":
                    r.length <= 0 ? this.tim.context.login = Hr.IS_NOT_LOGIN : this.tim.context.login = null !== this.tim.context.tinyID ? Hr.IS_LOGIN : Hr.IS_NOT_LOGIN;
                }
            }
        } ]), n;
    }(), Jr = {
        JSON: {
            TYPE: {
                C2C: {
                    NOTICE: 1,
                    COMMON: 9,
                    EVENT: 10
                },
                GROUP: {
                    COMMON: 3,
                    TIP: 4,
                    SYSTEM: 5,
                    TIP2: 6
                },
                FRIEND: {
                    NOTICE: 7
                },
                PROFILE: {
                    NOTICE: 8
                }
            },
            SUBTYPE: {
                C2C: {
                    COMMON: 0,
                    READED: 92,
                    KICKEDOUT: 96
                },
                GROUP: {
                    COMMON: 0,
                    LOVEMESSAGE: 1,
                    TIP: 2,
                    REDPACKET: 3
                }
            },
            OPTIONS: {
                GROUP: {
                    JOIN: 1,
                    QUIT: 2,
                    KICK: 3,
                    SET_ADMIN: 4,
                    CANCEL_ADMIN: 5,
                    MODIFY_GROUP_INFO: 6,
                    MODIFY_MEMBER_INFO: 7
                }
            }
        },
        PROTOBUF: {},
        IMAGE_TYPES: {
            ORIGIN: 1,
            LARGE: 2,
            SMALL: 3
        },
        IMAGE_FORMAT: {
            JPG: 1,
            JPEG: 1,
            GIF: 2,
            PNG: 3,
            BMP: 4,
            UNKNOWN: 255
        }
    }, Qr = {
        NICK: "Tag_Profile_IM_Nick",
        GENDER: "Tag_Profile_IM_Gender",
        BIRTHDAY: "Tag_Profile_IM_BirthDay",
        LOCATION: "Tag_Profile_IM_Location",
        SELFSIGNATURE: "Tag_Profile_IM_SelfSignature",
        ALLOWTYPE: "Tag_Profile_IM_AllowType",
        LANGUAGE: "Tag_Profile_IM_Language",
        AVATAR: "Tag_Profile_IM_Image",
        MESSAGESETTINGS: "Tag_Profile_IM_MsgSettings",
        ADMINFORBIDTYPE: "Tag_Profile_IM_AdminForbidType",
        LEVEL: "Tag_Profile_IM_Level",
        ROLE: "Tag_Profile_IM_Role"
    }, Zr = {
        UNKNOWN: "Gender_Type_Unknown",
        FEMALE: "Gender_Type_Female",
        MALE: "Gender_Type_Male"
    }, eo = {
        NONE: "AdminForbid_Type_None",
        SEND_OUT: "AdminForbid_Type_SendOut"
    }, to = {
        NEED_CONFIRM: "AllowType_Type_NeedConfirm",
        ALLOW_ANY: "AllowType_Type_AllowAny",
        DENY_ANY: "AllowType_Type_DenyAny"
    }, no = function e(t) {
        a(this, e), this.code = 0, this.data = t || {};
    }, ro = null, oo = function(e) {
        return e instanceof no ? ($.warn("IMPromise.resolve 此函数会自动用options创建IMResponse实例，调用侧不需创建，建议修改！"), 
        Promise.resolve(e)) : Promise.resolve(new no(e));
    }, io = function(e) {
        var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
        if (e instanceof qn) return t && null !== ro && ro.emit(l.ERROR, e), Promise.reject(e);
        if (e instanceof Error) {
            $.warn("IMPromise.reject options not instanceof IMError! details:", e);
            var n = new qn({
                code: Pt,
                message: e.message
            });
            return t && null !== ro && ro.emit(l.ERROR, n), Promise.reject(n);
        }
        if (te(e) || te(e.code) || te(e.message)) $.error("IMPromise.reject 必须指定code(错误码)和message(错误信息)!!!"); else {
            if (X(e.code) && J(e.message)) {
                var r = new qn(e);
                return t && null !== ro && ro.emit(l.ERROR, r), Promise.reject(r);
            }
            $.error("IMPromise.reject code(错误码)必须为数字，message(错误信息)必须为字符串!!!");
        }
    }, so = "sdkReady", ao = "login", uo = "longpolling", co = "longpollingAV", lo = "sendMessage", po = "initConversationList", ho = "initGroupList", fo = "upload", go = function() {
        function t() {
            a(this, t), this.SDKAppID = "", this.version = "", this.tinyID = "", this.userID = "", 
            this.platform = "", this.method = "", this.time = "", this.startts = 0, this.endts = 0, 
            this.timespan = 0, this.codeint = "0", this.message = "", this.text = "", this.msgType = "", 
            this.networkType = "", this.platform = "", this._sentFlag = 0;
        }
        return i(t, [ {
            key: "setCommonInfo",
            value: function(e, t, n, r, o) {
                this.SDKAppID = "".concat(e), this.version = "".concat(t), this.tinyID = n, this.userID = r, 
                this.platform = o, this.time = pe(), this.startts && this.endts && !this.timespan && (this.timespan = Math.abs(this.endts - this.startts));
            }
        }, {
            key: "setMethod",
            value: function(e) {
                return this.method = e, this;
            }
        }, {
            key: "setStart",
            value: function() {
                this.startts = Date.now();
            }
        }, {
            key: "setEnd",
            value: function() {
                var e = this, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0;
                this._sentFlag || (this.endts = Date.now(), t ? (this._sentFlag = 1, this._eventStatController.pushIn(this)) : setTimeout(function() {
                    e._sentFlag = 1, e._eventStatController.pushIn(e);
                }, 0));
            }
        }, {
            key: "setError",
            value: function(e, t, n) {
                return e instanceof Error ? this._sentFlag || (this.setNetworkType(n), t ? (e.code && this.setCode(e.code), 
                e.message && this.setMessage(e.message)) : (this.setCode(At), this.setMessage(On))) : $.warn("SSOLogData.setError value not instanceof Error, please check!"), 
                this;
            }
        }, {
            key: "setCode",
            value: function(e) {
                return te(e) || this._sentFlag || (X(e) ? this.codeint = e.toString() : $.warn("SSOLogData.setCode value not a number, please check!")), 
                this;
            }
        }, {
            key: "setMessage",
            value: function(e) {
                return te(e) || this._sentFlag || J(e) && (this.message = e), this;
            }
        }, {
            key: "setText",
            value: function(e) {
                return X(e) ? this.text = e.toString() : J(e) && (this.text = e), this;
            }
        }, {
            key: "setMessageType",
            value: function(e) {
                return this.msgType = e, this;
            }
        }, {
            key: "setNetworkType",
            value: function(e) {
                return this.networkType = e, this;
            }
        } ], [ {
            key: "bindController",
            value: function(e) {
                t.prototype._eventStatController = e;
            }
        } ]), t;
    }(), mo = "sdkConstruct", yo = "sdkReady", vo = "accessLayer", _o = "login", Io = "upload", Co = "sendMessage", Mo = "getConversationList", Do = "getConversationListInStorage", So = "syncConversationList", ko = "createGroup", To = "getGroupList", Eo = "getGroupListInStorage", Ao = "longPollingError", wo = "getUserProfile", Lo = "getBlacklist", Ro = "mpHideToShow", Po = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initializeListener(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "login",
            value: function(e) {
                if (this._isLogin()) {
                    var t = "您已经登录账号".concat(e.identifier, "！如需切换账号登录，请先调用 logout 接口登出，再调用 login 接口登录。");
                    return $.warn(t), oo(new no({
                        actionStatus: "OK",
                        errorCode: 0,
                        errorInfo: t
                    }));
                }
                $.log("SignController.login userID=", e.identifier), $.time(ao);
                var n = this._checkLoginInfo(e);
                return ke(n) ? (this.tim.context.identifier = e.identifier, this.tim.context.userSig = e.userSig, 
                this.tim.context.SDKAppID = e.SDKAppID, this.tim.context.accountType = e.accountType, 
                this.tim.context.identifier && this.tim.context.userSig ? (this.tim.innerEmitter.emit(Sr), 
                this._accessLayer()) : void 0) : io(n);
            }
        }, {
            key: "_isLogin",
            value: function() {
                return !!this.tim.context.a2Key;
            }
        }, {
            key: "_isLoginCurrentUser",
            value: function(e) {
                return this.tim.context.identifier === e;
            }
        }, {
            key: "_initializeListener",
            value: function() {
                this.innerEmitter.on(fr, this._onKickedOut, this), this.innerEmitter.on(gr, this._onMultipleDeviceKickedOut, this);
            }
        }, {
            key: "_accessLayer",
            value: function() {
                var r = this, o = new go();
                o.setMethod(vo).setStart(), $.log("SignController._accessLayer.");
                var e = this.createPackage({
                    name: "accessLayer",
                    action: "query"
                });
                return this.tim.connectionController.request(e).then(function(e) {
                    return o.setCode(0).setNetworkType(r.getNetworkType()).setText(e.data.webImAccessLayer).setEnd(), 
                    $.log("SignController._accessLayer ok. webImAccessLayer=", e.data.webImAccessLayer), 
                    1 === e.data.webImAccessLayer && Vn.HOST.setCurrent(e.data.webImAccessLayer), r._login();
                }).catch(function(n) {
                    return r.probeNetwork().then(function(e, t) {
                        o.setError(n, e, t).setEnd(1), r.tim.eventStatController.reportAtOnce();
                    }), $.error("SignController._accessLayer error:", n), io(n);
                });
            }
        }, {
            key: "_login",
            value: function() {
                var r = this, o = new go();
                o.setMethod(_o).setStart();
                var e = this.createPackage({
                    name: "login",
                    action: "query"
                });
                return this.connectionController.request(e).then(function(e) {
                    var t = null;
                    if (!e.data.tinyID) throw t = new qn({
                        code: be,
                        message: Ft
                    }), o.setError(t, 1, r.getNetworkType()).setEnd(), t;
                    if (!e.data.a2Key) throw t = new qn({
                        code: Ne,
                        message: Bt
                    }), o.setError(t, 1, r.getNetworkType()).setEnd(), t;
                    return o.setCode(0).setNetworkType(r.getNetworkType()).setText("".concat(r.tim.loginInfo.identifier)).setEnd(), 
                    $.log("SignController.login ok. userID=".concat(r.tim.loginInfo.identifier, " loginCost=").concat($.timeEnd(ao), "ms")), 
                    r.tim.innerEmitter.emit(kr, {
                        data: {
                            a2Key: e.data.a2Key,
                            tinyID: e.data.tinyID
                        }
                    }), oo(e.data);
                }).catch(function(n) {
                    return r.probeNetwork().then(function(e, t) {
                        o.setError(n, e, t).setEnd(1);
                    }), $.error("SignController.login error:", n), io(n);
                });
            }
        }, {
            key: "logout",
            value: function() {
                return $.info("SignController.logout"), this.tim.innerEmitter.emit(Tr), this._logout(1).then(this._emitLogoutSuccess.bind(this)).catch(this._emitLogoutSuccess.bind(this));
            }
        }, {
            key: "_logout",
            value: function(e) {
                var t = this.tim.notificationController, n = 0 === e ? "logout" : "longPollLogout", r = 0 === e ? {
                    name: n,
                    action: "query"
                } : {
                    name: n,
                    action: "query",
                    param: {
                        longPollID: t.getLongPollID()
                    }
                }, o = this.createPackage(r);
                return this.connectionController.request(o).catch(function(e) {
                    return $.error("SignController._logout error:", e), io(e);
                });
            }
        }, {
            key: "_checkLoginInfo",
            value: function(e) {
                var t = 0, n = "";
                return null === e.SDKAppID ? (t = we, n = Nt) : null === e.accountType ? (t = Le, 
                n = Gt) : null === e.identifier ? (t = Re, n = Ut) : null === e.userSig && (t = Pe, 
                n = qt), ke(t) || ke(n) ? {} : {
                    code: t,
                    message: n
                };
            }
        }, {
            key: "_emitLogoutSuccess",
            value: function() {
                return this.tim.innerEmitter.emit(Er), oo({});
            }
        }, {
            key: "_onKickedOut",
            value: function() {
                var e = this;
                this.tim.logout().then(function() {
                    $.warn("SignController._onKickedOut kicked out.       userID=".concat(e.tim.loginInfo.identifier)), 
                    e.tim.outerEmitter.emit(l.KICKED_OUT, {
                        type: B.KICKED_OUT_MULT_ACCOUNT
                    });
                });
            }
        }, {
            key: "_onMultipleDeviceKickedOut",
            value: function() {
                var e = this;
                this.tim.logout().then(function() {
                    $.warn("SignController._onKickedOut kicked out.       userID=".concat(e.tim.loginInfo.identifier)), 
                    e.tim.outerEmitter.emit(l.KICKED_OUT, {
                        type: B.KICKED_OUT_MULT_DEVICE
                    });
                });
            }
        }, {
            key: "reset",
            value: function() {}
        } ]), n;
    }(), Oo = function(n, r) {
        return function() {
            for (var e = new Array(arguments.length), t = 0; t < e.length; t++) e[t] = arguments[t];
            return n.apply(r, e);
        };
    }, bo = Object.prototype.toString;
    function No(e) {
        return "[object Array]" === bo.call(e);
    }
    function Go(e) {
        return null !== e && "object" == (void 0 === e ? "undefined" : _typeof(e));
    }
    function Uo(e) {
        return "[object Function]" === bo.call(e);
    }
    function qo(e, t) {
        if (null != e) if ("object" != (void 0 === e ? "undefined" : _typeof(e)) && (e = [ e ]), 
        No(e)) for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e); else for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.call(null, e[o], o, e);
    }
    var xo = {
        isArray: No,
        isArrayBuffer: function(e) {
            return "[object ArrayBuffer]" === bo.call(e);
        },
        isBuffer: function(e) {
            return null != e && null != e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
        },
        isFormData: function(e) {
            return "undefined" != typeof FormData && e instanceof FormData;
        },
        isArrayBufferView: function(e) {
            return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer;
        },
        isString: function(e) {
            return "string" == typeof e;
        },
        isNumber: function(e) {
            return "number" == typeof e;
        },
        isObject: Go,
        isUndefined: function(e) {
            return void 0 === e;
        },
        isDate: function(e) {
            return "[object Date]" === bo.call(e);
        },
        isFile: function(e) {
            return "[object File]" === bo.call(e);
        },
        isBlob: function(e) {
            return "[object Blob]" === bo.call(e);
        },
        isFunction: Uo,
        isStream: function(e) {
            return Go(e) && Uo(e.pipe);
        },
        isURLSearchParams: function(e) {
            return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams;
        },
        isStandardBrowserEnv: function() {
            return "undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product ? "undefined" != typeof window && "undefined" != typeof document : 0;
        },
        forEach: qo,
        merge: function n() {
            var r = {};
            function e(e, t) {
                "object" == _typeof(r[t]) && "object" == (void 0 === e ? "undefined" : _typeof(e)) ? r[t] = n(r[t], e) : r[t] = e;
            }
            for (var t = 0, o = arguments.length; t < o; t++) qo(arguments[t], e);
            return r;
        },
        deepMerge: function n() {
            var r = {};
            function e(e, t) {
                "object" == _typeof(r[t]) && "object" == (void 0 === e ? "undefined" : _typeof(e)) ? r[t] = n(r[t], e) : r[t] = "object" == (void 0 === e ? "undefined" : _typeof(e)) ? n({}, e) : e;
            }
            for (var t = 0, o = arguments.length; t < o; t++) qo(arguments[t], e);
            return r;
        },
        extend: function(n, e, r) {
            return qo(e, function(e, t) {
                n[t] = r && "function" == typeof e ? Oo(e, r) : e;
            }), n;
        },
        trim: function(e) {
            return e.replace(/^\s*/, "").replace(/\s*$/, "");
        }
    };
    function Fo(e) {
        return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
    }
    var Bo = function(e, t, n) {
        if (!t) return e;
        var r;
        if (n) r = n(t); else if (xo.isURLSearchParams(t)) r = t.toString(); else {
            var o = [];
            xo.forEach(t, function(e, t) {
                null != e && (xo.isArray(e) ? t += "[]" : e = [ e ], xo.forEach(e, function(e) {
                    xo.isDate(e) ? e = e.toISOString() : xo.isObject(e) && (e = JSON.stringify(e)), 
                    o.push(Fo(t) + "=" + Fo(e));
                }));
            }), r = o.join("&");
        }
        if (r) {
            var i = e.indexOf("#");
            -1 !== i && (e = e.slice(0, i)), e += (-1 === e.indexOf("?") ? "?" : "&") + r;
        }
        return e;
    };
    function Ho() {
        this.handlers = [];
    }
    Ho.prototype.use = function(e, t) {
        return this.handlers.push({
            fulfilled: e,
            rejected: t
        }), this.handlers.length - 1;
    }, Ho.prototype.eject = function(e) {
        this.handlers[e] && (this.handlers[e] = null);
    }, Ho.prototype.forEach = function(t) {
        xo.forEach(this.handlers, function(e) {
            null !== e && t(e);
        });
    };
    var jo = Ho, Vo = function(t, n, e) {
        return xo.forEach(e, function(e) {
            t = e(t, n);
        }), t;
    }, Ko = function(e) {
        return !(!e || !e.__CANCEL__);
    };
    function $o() {
        throw new Error("setTimeout has not been defined");
    }
    function zo() {
        throw new Error("clearTimeout has not been defined");
    }
    var Yo = $o, Wo = zo;
    function Xo(t) {
        if (Yo === setTimeout) return setTimeout(t, 0);
        if ((Yo === $o || !Yo) && setTimeout) return Yo = setTimeout, setTimeout(t, 0);
        try {
            return Yo(t, 0);
        } catch (e) {
            try {
                return Yo.call(null, t, 0);
            } catch (e) {
                return Yo.call(this, t, 0);
            }
        }
    }
    "function" == typeof N.setTimeout && (Yo = setTimeout), "function" == typeof N.clearTimeout && (Wo = clearTimeout);
    var Jo, Qo = [], Zo = 0, ei = -1;
    function ti() {
        Zo && Jo && (Zo = 0, Jo.length ? Qo = Jo.concat(Qo) : ei = -1, Qo.length && ni());
    }
    function ni() {
        if (!Zo) {
            var e = Xo(ti);
            Zo = 1;
            for (var t = Qo.length; t; ) {
                for (Jo = Qo, Qo = []; ++ei < t; ) Jo && Jo[ei].run();
                ei = -1, t = Qo.length;
            }
            Jo = null, Zo = 0, function(t) {
                if (Wo === clearTimeout) return clearTimeout(t);
                if ((Wo === zo || !Wo) && clearTimeout) return Wo = clearTimeout, clearTimeout(t);
                try {
                    Wo(t);
                } catch (e) {
                    try {
                        return Wo.call(null, t);
                    } catch (e) {
                        return Wo.call(this, t);
                    }
                }
            }(e);
        }
    }
    function ri(e, t) {
        this.fun = e, this.array = t;
    }
    function oi() {}
    ri.prototype.run = function() {
        this.fun.apply(null, this.array);
    };
    var ii = oi, si = oi, ai = oi, ui = oi, ci = oi, li = oi, pi = oi, hi = N.performance || {}, fi = hi.now || hi.mozNow || hi.msNow || hi.oNow || hi.webkitNow || function() {
        return new Date().getTime();
    }, gi = new Date(), di = {
        nextTick: function(e) {
            var t = new Array(arguments.length - 1);
            if (1 < arguments.length) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
            Qo.push(new ri(e, t)), 1 !== Qo.length || Zo || Xo(ni);
        },
        title: "browser",
        browser: 1,
        env: {},
        argv: [],
        version: "",
        versions: {},
        on: ii,
        addListener: si,
        once: ai,
        off: ui,
        removeListener: ci,
        removeAllListeners: li,
        emit: pi,
        binding: function(e) {
            throw new Error("process.binding is not supported");
        },
        cwd: function() {
            return "/";
        },
        chdir: function(e) {
            throw new Error("process.chdir is not supported");
        },
        umask: function() {
            return 0;
        },
        hrtime: function(e) {
            var t = .001 * fi.call(hi), n = Math.floor(t), r = Math.floor(t % 1 * 1e9);
            return e && (n -= e[0], (r -= e[1]) < 0 && (n--, r += 1e9)), [ n, r ];
        },
        platform: "browser",
        release: {},
        config: {},
        uptime: function() {
            return (new Date() - gi) / 1e3;
        }
    }, mi = function(n, r) {
        xo.forEach(n, function(e, t) {
            t !== r && t.toUpperCase() === r.toUpperCase() && (n[r] = e, delete n[t]);
        });
    }, yi = function(e, t, n, r, o) {
        return i = new Error(e), s = t, a = n, u = r, c = o, i.config = s, a && (i.code = a), 
        i.request = u, i.response = c, i.isAxiosError = 1, i.toJSON = function() {
            return {
                message: this.message,
                name: this.name,
                description: this.description,
                number: this.number,
                fileName: this.fileName,
                lineNumber: this.lineNumber,
                columnNumber: this.columnNumber,
                stack: this.stack,
                config: this.config,
                code: this.code
            };
        }, i;
        var i, s, a, u, c;
    }, vi = [ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ], _i = xo.isStandardBrowserEnv() ? function() {
        var n, r = /(msie|trident)/i.test(navigator.userAgent), o = document.createElement("a");
        function i(e) {
            var t = e;
            return r && (o.setAttribute("href", t), t = o.href), o.setAttribute("href", t), 
            {
                href: o.href,
                protocol: o.protocol ? o.protocol.replace(/:$/, "") : "",
                host: o.host,
                search: o.search ? o.search.replace(/^\?/, "") : "",
                hash: o.hash ? o.hash.replace(/^#/, "") : "",
                hostname: o.hostname,
                port: o.port,
                pathname: "/" === o.pathname.charAt(0) ? o.pathname : "/" + o.pathname
            };
        }
        return n = i(window.location.href), function(e) {
            var t = xo.isString(e) ? i(e) : e;
            return t.protocol === n.protocol && t.host === n.host;
        };
    }() : function() {
        return 1;
    }, Ii = xo.isStandardBrowserEnv() ? {
        write: function(e, t, n, r, o, i) {
            var s = [];
            s.push(e + "=" + encodeURIComponent(t)), xo.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), 
            xo.isString(r) && s.push("path=" + r), xo.isString(o) && s.push("domain=" + o), 
            1 == i && s.push("secure"), document.cookie = s.join("; ");
        },
        read: function(e) {
            var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
            return t ? decodeURIComponent(t[3]) : null;
        },
        remove: function(e) {
            this.write(e, "", Date.now() - 864e5);
        }
    } : {
        write: function() {},
        read: function() {
            return null;
        },
        remove: function() {}
    }, Ci = function(g) {
        return new Promise(function(p, h) {
            var n = g.data, r = g.headers;
            xo.isFormData(n) && delete r["Content-Type"];
            var f = new XMLHttpRequest();
            if (g.auth) {
                var e = g.auth.username || "", t = g.auth.password || "";
                r.Authorization = "Basic " + btoa(e + ":" + t);
            }
            if (f.open(g.method.toUpperCase(), Bo(g.url, g.params, g.paramsSerializer), 1), 
            f.timeout = g.timeout, f.onreadystatechange = function() {
                if (f && 4 === f.readyState && (0 !== f.status || f.responseURL && 0 === f.responseURL.indexOf("file:"))) {
                    var e, t, n, r, o, i = "getAllResponseHeaders" in f ? (e = f.getAllResponseHeaders(), 
                    o = {}, e && xo.forEach(e.split("\n"), function(e) {
                        if (r = e.indexOf(":"), t = xo.trim(e.substr(0, r)).toLowerCase(), n = xo.trim(e.substr(r + 1)), 
                        t) {
                            if (o[t] && 0 <= vi.indexOf(t)) return;
                            o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([ n ]) : o[t] ? o[t] + ", " + n : n;
                        }
                    }), o) : null, s = {
                        data: g.responseType && "text" !== g.responseType ? f.response : f.responseText,
                        status: f.status,
                        statusText: f.statusText,
                        headers: i,
                        config: g,
                        request: f
                    };
                    a = p, u = h, !(l = (c = s).config.validateStatus) || l(c.status) ? a(c) : u(yi("Request failed with status code " + c.status, c.config, null, c.request, c)), 
                    f = null;
                }
                var a, u, c, l;
            }, f.onabort = function() {
                f && (h(yi("Request aborted", g, "ECONNABORTED", f)), f = null);
            }, f.onerror = function() {
                h(yi("Network Error", g, null, f)), f = null;
            }, f.ontimeout = function() {
                h(yi("timeout of " + g.timeout + "ms exceeded", g, "ECONNABORTED", f)), f = null;
            }, xo.isStandardBrowserEnv()) {
                var o = Ii, i = (g.withCredentials || _i(g.url)) && g.xsrfCookieName ? o.read(g.xsrfCookieName) : void 0;
                i && (r[g.xsrfHeaderName] = i);
            }
            if ("setRequestHeader" in f && xo.forEach(r, function(e, t) {
                void 0 === n && "content-type" === t.toLowerCase() ? delete r[t] : f.setRequestHeader(t, e);
            }), g.withCredentials && (f.withCredentials = 1), g.responseType) try {
                f.responseType = g.responseType;
            } catch (e) {
                if ("json" !== g.responseType) throw e;
            }
            "function" == typeof g.onDownloadProgress && f.addEventListener("progress", g.onDownloadProgress), 
            "function" == typeof g.onUploadProgress && f.upload && f.upload.addEventListener("progress", g.onUploadProgress), 
            g.cancelToken && g.cancelToken.promise.then(function(e) {
                f && (f.abort(), h(e), f = null);
            }), void 0 === n && (n = null), f.send(n);
        });
    }, Mi = {
        "Content-Type": "application/x-www-form-urlencoded"
    };
    function Di(e, t) {
        !xo.isUndefined(e) && xo.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
    }
    var Si, ki = {
        adapter: (void 0 !== di && "[object process]" === Object.prototype.toString.call(di) ? Si = Ci : "undefined" != typeof XMLHttpRequest && (Si = Ci), 
        Si),
        transformRequest: [ function(e, t) {
            return mi(t, "Accept"), mi(t, "Content-Type"), xo.isFormData(e) || xo.isArrayBuffer(e) || xo.isBuffer(e) || xo.isStream(e) || xo.isFile(e) || xo.isBlob(e) ? e : xo.isArrayBufferView(e) ? e.buffer : xo.isURLSearchParams(e) ? (Di(t, "application/x-www-form-urlencoded;charset=utf-8"), 
            e.toString()) : xo.isObject(e) ? (Di(t, "application/json;charset=utf-8"), JSON.stringify(e)) : e;
        } ],
        transformResponse: [ function(e) {
            if ("string" == typeof e) try {
                e = JSON.parse(e);
            } catch (e) {}
            return e;
        } ],
        timeout: 0,
        xsrfCookieName: "XSRF-TOKEN",
        xsrfHeaderName: "X-XSRF-TOKEN",
        maxContentLength: -1,
        validateStatus: function(e) {
            return 200 <= e && e < 300;
        },
        headers: {
            common: {
                Accept: "application/json, text/plain, */*"
            }
        }
    };
    xo.forEach([ "delete", "get", "head" ], function(e) {
        ki.headers[e] = {};
    }), xo.forEach([ "post", "put", "patch" ], function(e) {
        ki.headers[e] = xo.merge(Mi);
    });
    var Ti = ki;
    function Ei(e) {
        e.cancelToken && e.cancelToken.throwIfRequested();
    }
    var Ai = function(t) {
        var e, n, r;
        return Ei(t), t.baseURL && (r = t.url, !/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)) && (t.url = (e = t.baseURL, 
        (n = t.url) ? e.replace(/\/+$/, "") + "/" + n.replace(/^\/+/, "") : e)), t.headers = t.headers || {}, 
        t.data = Vo(t.data, t.headers, t.transformRequest), t.headers = xo.merge(t.headers.common || {}, t.headers[t.method] || {}, t.headers || {}), 
        xo.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(e) {
            delete t.headers[e];
        }), (t.adapter || Ti.adapter)(t).then(function(e) {
            return Ei(t), e.data = Vo(e.data, e.headers, t.transformResponse), e;
        }, function(e) {
            return Ko(e) || (Ei(t), e && e.response && (e.response.data = Vo(e.response.data, e.response.headers, t.transformResponse))), 
            Promise.reject(e);
        });
    }, wi = function(t, n) {
        n = n || {};
        var r = {};
        return xo.forEach([ "url", "method", "params", "data" ], function(e) {
            void 0 !== n[e] && (r[e] = n[e]);
        }), xo.forEach([ "headers", "auth", "proxy" ], function(e) {
            xo.isObject(n[e]) ? r[e] = xo.deepMerge(t[e], n[e]) : void 0 !== n[e] ? r[e] = n[e] : xo.isObject(t[e]) ? r[e] = xo.deepMerge(t[e]) : void 0 !== t[e] && (r[e] = t[e]);
        }), xo.forEach([ "baseURL", "transformRequest", "transformResponse", "paramsSerializer", "timeout", "withCredentials", "adapter", "responseType", "xsrfCookieName", "xsrfHeaderName", "onUploadProgress", "onDownloadProgress", "maxContentLength", "validateStatus", "maxRedirects", "httpAgent", "httpsAgent", "cancelToken", "socketPath" ], function(e) {
            void 0 !== n[e] ? r[e] = n[e] : void 0 !== t[e] && (r[e] = t[e]);
        }), r;
    };
    function Li(e) {
        this.defaults = e, this.interceptors = {
            request: new jo(),
            response: new jo()
        };
    }
    Li.prototype.request = function(e) {
        "string" == typeof e ? (e = arguments[1] || {}).url = e : e = e || {}, (e = wi(this.defaults, e)).method = e.method ? e.method.toLowerCase() : "get";
        var t = [ Ai, void 0 ], n = Promise.resolve(e);
        for (this.interceptors.request.forEach(function(e) {
            t.unshift(e.fulfilled, e.rejected);
        }), this.interceptors.response.forEach(function(e) {
            t.push(e.fulfilled, e.rejected);
        }); t.length; ) n = n.then(t.shift(), t.shift());
        return n;
    }, Li.prototype.getUri = function(e) {
        return e = wi(this.defaults, e), Bo(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
    }, xo.forEach([ "delete", "get", "head", "options" ], function(n) {
        Li.prototype[n] = function(e, t) {
            return this.request(xo.merge(t || {}, {
                method: n,
                url: e
            }));
        };
    }), xo.forEach([ "post", "put", "patch" ], function(r) {
        Li.prototype[r] = function(e, t, n) {
            return this.request(xo.merge(n || {}, {
                method: r,
                url: e,
                data: t
            }));
        };
    });
    var Ri = Li;
    function Pi(e) {
        this.message = e;
    }
    Pi.prototype.toString = function() {
        return "Cancel" + (this.message ? ": " + this.message : "");
    }, Pi.prototype.__CANCEL__ = 1;
    var Oi = Pi;
    function bi(e) {
        if ("function" != typeof e) throw new TypeError("executor must be a function.");
        var t;
        this.promise = new Promise(function(e) {
            t = e;
        });
        var n = this;
        e(function(e) {
            n.reason || (n.reason = new Oi(e), t(n.reason));
        });
    }
    bi.prototype.throwIfRequested = function() {
        if (this.reason) throw this.reason;
    }, bi.source = function() {
        var t;
        return {
            token: new bi(function(e) {
                t = e;
            }),
            cancel: t
        };
    };
    var Ni = bi;
    function Gi(e) {
        var t = new Ri(e), n = Oo(Ri.prototype.request, t);
        return xo.extend(n, Ri.prototype, t), xo.extend(n, t), n;
    }
    var Ui = Gi(Ti);
    Ui.Axios = Ri, Ui.create = function(e) {
        return Gi(wi(Ui.defaults, e));
    }, Ui.Cancel = Oi, Ui.CancelToken = Ni, Ui.isCancel = Ko, Ui.all = function(e) {
        return Promise.all(e);
    }, Ui.spread = function(t) {
        return function(e) {
            return t.apply(null, e);
        };
    };
    var qi = Ui, xi = Ui;
    qi.default = xi;
    var Fi = qi, Bi = Fi.create({
        timeout: 6e3,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
        }
    });
    Bi.interceptors.response.use(function(e) {
        var t = e.data, n = t.error_code, r = t.ErrorCode;
        return X(n) && (r = n), r !== Br.SUCCESS && (e.data.ErrorCode = Number(r)), e;
    }, function(e) {
        return "Network Error" === e.message && (1 == Bi.defaults.withCredentials && $.warn("Network Error, try to close `IMAxios.defaults.withCredentials` to false. (IMAxios.js)"), 
        Bi.defaults.withCredentials = 0), Promise.reject(e);
    });
    var Hi = function() {
        function e() {
            a(this, e);
        }
        return i(e, [ {
            key: "request",
            value: function(e) {
                console.warn("请注意： ConnectionBase.request() 方法必须被派生类重写:"), console.log("参数如下：\n    * @param {String} options.url string 是 开发者服务器接口地址\n    * @param {*} options.data - string/object/ArrayBuffer 否 请求的参数\n    * @param {Object} options.header - Object 否 设置请求的 header，\n    * @param {String} options.method - string GET 否 HTTP 请求方法\n    * @param {String} options.dataType - string json 否 返回的数据格式\n    * @param {String} options.responseType - string text 否 响应的数据类型\n    * @param {Boolean} isRetry - string text false 是否为重试的请求\n   ");
            }
        }, {
            key: "_checkOptions",
            value: function(e) {
                if (0 == !!e.url) throw new qn({
                    code: kt,
                    message: Ln
                });
            }
        }, {
            key: "_initOptions",
            value: function(e) {
                e.method = 0 <= [ "POST", "GET", "PUT", "DELETE", "OPTION" ].indexOf(e.method) ? e.method : "POST", 
                e.dataType = e.dataType || "json", e.responseType = e.responseType || "json";
            }
        } ]), e;
    }(), ji = function(e) {
        function t() {
            var e;
            return a(this, t), (e = g(this, c(t).call(this))).retry = 2, e;
        }
        return u(t, Hi), i(t, [ {
            key: "request",
            value: function(e) {
                return this._checkOptions(e), this._initOptions(e), this._requestWithRetry({
                    url: e.url,
                    data: e.data,
                    method: e.method
                });
            }
        }, {
            key: "_requestWithRetry",
            value: function(t) {
                var n = this, r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
                return Bi(t).catch(function(e) {
                    return n.retry && r < n.retry ? n._requestWithRetry(t, ++r) : io(new qn({
                        code: e.code || "",
                        message: e.message || ""
                    }));
                });
            }
        } ]), t;
    }(), Vi = [], Ki = [], $i = "undefined" != typeof Uint8Array ? Uint8Array : Array, zi = 0;
    function Yi() {
        zi = 1;
        for (var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", t = 0, n = e.length; t < n; ++t) Vi[t] = e[t], 
        Ki[e.charCodeAt(t)] = t;
        Ki["-".charCodeAt(0)] = 62, Ki["_".charCodeAt(0)] = 63;
    }
    function Wi(e, t, n) {
        for (var r, o, i = [], s = t; s < n; s += 3) r = (e[s] << 16) + (e[s + 1] << 8) + e[s + 2], 
        i.push(Vi[(o = r) >> 18 & 63] + Vi[o >> 12 & 63] + Vi[o >> 6 & 63] + Vi[63 & o]);
        return i.join("");
    }
    function Xi(e) {
        var t;
        zi || Yi();
        for (var n = e.length, r = n % 3, o = "", i = [], s = 0, a = n - r; s < a; s += 16383) i.push(Wi(e, s, a < s + 16383 ? a : s + 16383));
        return 1 === r ? (t = e[n - 1], o += Vi[t >> 2], o += Vi[t << 4 & 63], o += "==") : 2 === r && (t = (e[n - 2] << 8) + e[n - 1], 
        o += Vi[t >> 10], o += Vi[t >> 4 & 63], o += Vi[t << 2 & 63], o += "="), i.push(o), 
        i.join("");
    }
    function Ji(e, t, n, r, o) {
        var i, s, a = 8 * o - r - 1, u = (1 << a) - 1, c = u >> 1, l = -7, p = n ? o - 1 : 0, h = n ? -1 : 1, f = e[t + p];
        for (p += h, i = f & (1 << -l) - 1, f >>= -l, l += a; 0 < l; i = 256 * i + e[t + p], 
        p += h, l -= 8) ;
        for (s = i & (1 << -l) - 1, i >>= -l, l += r; 0 < l; s = 256 * s + e[t + p], p += h, 
        l -= 8) ;
        if (0 === i) i = 1 - c; else {
            if (i === u) return s ? NaN : 1 / 0 * (f ? -1 : 1);
            s += Math.pow(2, r), i -= c;
        }
        return (f ? -1 : 1) * s * Math.pow(2, i - r);
    }
    function Qi(e, t, n, r, o, i) {
        var s, a, u, c = 8 * i - o - 1, l = (1 << c) - 1, p = l >> 1, h = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = r ? 0 : i - 1, g = r ? 1 : -1, d = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
        for (t = Math.abs(t), isNaN(t) || 1 / 0 === t ? (a = isNaN(t) ? 1 : 0, s = l) : (s = Math.floor(Math.log(t) / Math.LN2), 
        t * (u = Math.pow(2, -s)) < 1 && (s--, u *= 2), 2 <= (t += 1 <= s + p ? h / u : h * Math.pow(2, 1 - p)) * u && (s++, 
        u /= 2), l <= s + p ? (a = 0, s = l) : 1 <= s + p ? (a = (t * u - 1) * Math.pow(2, o), 
        s += p) : (a = t * Math.pow(2, p - 1) * Math.pow(2, o), s = 0)); 8 <= o; e[n + f] = 255 & a, 
        f += g, a /= 256, o -= 8) ;
        for (s = s << o | a, c += o; 0 < c; e[n + f] = 255 & s, f += g, s /= 256, c -= 8) ;
        e[n + f - g] |= 128 * d;
    }
    var Zi = {}.toString, es = Array.isArray || function(e) {
        return "[object Array]" == Zi.call(e);
    };
    function ts() {
        return rs.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
    }
    function ns(e, t) {
        if (ts() < t) throw new RangeError("Invalid typed array length");
        return rs.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = rs.prototype : (null === e && (e = new rs(t)), 
        e.length = t), e;
    }
    function rs(e, t, n) {
        if (!(rs.TYPED_ARRAY_SUPPORT || this instanceof rs)) return new rs(e, t, n);
        if ("number" == typeof e) {
            if ("string" == typeof t) throw new Error("If encoding is specified then the first argument must be a string");
            return ss(this, e);
        }
        return os(this, e, t, n);
    }
    function os(e, t, n, r) {
        if ("number" == typeof t) throw new TypeError('"value" argument must not be a number');
        return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, n, r) {
            if (t.byteLength, n < 0 || t.byteLength < n) throw new RangeError("'offset' is out of bounds");
            if (t.byteLength < n + (r || 0)) throw new RangeError("'length' is out of bounds");
            return t = void 0 === n && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, n) : new Uint8Array(t, n, r), 
            rs.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = rs.prototype : e = as(e, t), e;
        }(e, t, n, r) : "string" == typeof t ? function(e, t, n) {
            if ("string" == typeof n && "" !== n || (n = "utf8"), !rs.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding');
            var r = 0 | ls(t, n), o = (e = ns(e, r)).write(t, n);
            return o !== r && (e = e.slice(0, o)), e;
        }(e, t, n) : function(e, t) {
            if (cs(t)) {
                var n = 0 | us(t.length);
                return 0 === (e = ns(e, n)).length || t.copy(e, 0, 0, n), e;
            }
            if (t) {
                if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length" in t) return "number" != typeof t.length || (r = t.length) != r ? ns(e, 0) : as(e, t);
                if ("Buffer" === t.type && es(t.data)) return as(e, t.data);
            }
            var r;
            throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
        }(e, t);
    }
    function is(e) {
        if ("number" != typeof e) throw new TypeError('"size" argument must be a number');
        if (e < 0) throw new RangeError('"size" argument must not be negative');
    }
    function ss(e, t) {
        if (is(t), e = ns(e, t < 0 ? 0 : 0 | us(t)), !rs.TYPED_ARRAY_SUPPORT) for (var n = 0; n < t; ++n) e[n] = 0;
        return e;
    }
    function as(e, t) {
        var n = t.length < 0 ? 0 : 0 | us(t.length);
        e = ns(e, n);
        for (var r = 0; r < n; r += 1) e[r] = 255 & t[r];
        return e;
    }
    function us(e) {
        if (e >= ts()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + ts().toString(16) + " bytes");
        return 0 | e;
    }
    function cs(e) {
        return !(null == e || !e._isBuffer);
    }
    function ls(e, t) {
        if (cs(e)) return e.length;
        if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
        "string" != typeof e && (e = "" + e);
        var n = e.length;
        if (0 === n) return 0;
        for (var r = 0; ;) switch (t) {
          case "ascii":
          case "latin1":
          case "binary":
            return n;

          case "utf8":
          case "utf-8":
          case void 0:
            return Ls(e).length;

          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
            return 2 * n;

          case "hex":
            return n >>> 1;

          case "base64":
            return Rs(e).length;

          default:
            if (r) return Ls(e).length;
            t = ("" + t).toLowerCase(), r = 1;
        }
    }
    function ps(e, t, n) {
        var r = e[t];
        e[t] = e[n], e[n] = r;
    }
    function hs(e, t, n, r, o) {
        if (0 === e.length) return -1;
        if ("string" == typeof n ? (r = n, n = 0) : 2147483647 < n ? n = 2147483647 : n < -2147483648 && (n = -2147483648), 
        n = +n, isNaN(n) && (n = o ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
            if (o) return -1;
            n = e.length - 1;
        } else if (n < 0) {
            if (!o) return -1;
            n = 0;
        }
        if ("string" == typeof t && (t = rs.from(t, r)), cs(t)) return 0 === t.length ? -1 : fs(e, t, n, r, o);
        if ("number" == typeof t) return t &= 255, rs.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? o ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : fs(e, [ t ], n, r, o);
        throw new TypeError("val must be string, number or Buffer");
    }
    function fs(e, t, n, r, o) {
        var i, s = 1, a = e.length, u = t.length;
        if (void 0 !== r && ("ucs2" === (r = String(r).toLowerCase()) || "ucs-2" === r || "utf16le" === r || "utf-16le" === r)) {
            if (e.length < 2 || t.length < 2) return -1;
            a /= s = 2, u /= 2, n /= 2;
        }
        function c(e, t) {
            return 1 === s ? e[t] : e.readUInt16BE(t * s);
        }
        if (o) {
            var l = -1;
            for (i = n; i < a; i++) if (c(e, i) === c(t, -1 === l ? 0 : i - l)) {
                if (-1 === l && (l = i), i - l + 1 === u) return l * s;
            } else -1 !== l && (i -= i - l), l = -1;
        } else for (a < n + u && (n = a - u), i = n; 0 <= i; i--) {
            for (var p = 1, h = 0; h < u; h++) if (c(e, i + h) !== c(t, h)) {
                p = 0;
                break;
            }
            if (p) return i;
        }
        return -1;
    }
    function gs(e, t, n, r) {
        n = Number(n) || 0;
        var o = e.length - n;
        r ? (r = Number(r)) > o && (r = o) : r = o;
        var i = t.length;
        if (i % 2 != 0) throw new TypeError("Invalid hex string");
        i / 2 < r && (r = i / 2);
        for (var s = 0; s < r; ++s) {
            var a = parseInt(t.substr(2 * s, 2), 16);
            if (isNaN(a)) return s;
            e[n + s] = a;
        }
        return s;
    }
    function ds(e, t, n, r) {
        return Ps(function(e) {
            for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n));
            return t;
        }(t), e, n, r);
    }
    function ms(e, t, n) {
        n = Math.min(e.length, n);
        for (var r = [], o = t; o < n; ) {
            var i, s, a, u, c = e[o], l = null, p = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
            if (o + p <= n) switch (p) {
              case 1:
                c < 128 && (l = c);
                break;

              case 2:
                128 == (192 & (i = e[o + 1])) && 127 < (u = (31 & c) << 6 | 63 & i) && (l = u);
                break;

              case 3:
                i = e[o + 1], s = e[o + 2], 128 == (192 & i) && 128 == (192 & s) && 2047 < (u = (15 & c) << 12 | (63 & i) << 6 | 63 & s) && (u < 55296 || 57343 < u) && (l = u);
                break;

              case 4:
                i = e[o + 1], s = e[o + 2], a = e[o + 3], 128 == (192 & i) && 128 == (192 & s) && 128 == (192 & a) && 65535 < (u = (15 & c) << 18 | (63 & i) << 12 | (63 & s) << 6 | 63 & a) && u < 1114112 && (l = u);
            }
            null === l ? (l = 65533, p = 1) : 65535 < l && (l -= 65536, r.push(l >>> 10 & 1023 | 55296), 
            l = 56320 | 1023 & l), r.push(l), o += p;
        }
        return function(e) {
            var t = e.length;
            if (t <= ys) return String.fromCharCode.apply(String, e);
            for (var n = "", r = 0; r < t; ) n += String.fromCharCode.apply(String, e.slice(r, r += ys));
            return n;
        }(r);
    }
    rs.TYPED_ARRAY_SUPPORT = void 0 !== N.TYPED_ARRAY_SUPPORT ? N.TYPED_ARRAY_SUPPORT : 1, 
    rs.poolSize = 8192, rs._augment = function(e) {
        return e.__proto__ = rs.prototype, e;
    }, rs.from = function(e, t, n) {
        return os(null, e, t, n);
    }, rs.TYPED_ARRAY_SUPPORT && (rs.prototype.__proto__ = Uint8Array.prototype, rs.__proto__ = Uint8Array), 
    rs.alloc = function(e, t, n) {
        return o = t, i = n, is(r = e), r <= 0 ? ns(null, r) : void 0 !== o ? "string" == typeof i ? ns(null, r).fill(o, i) : ns(null, r).fill(o) : ns(null, r);
        var r, o, i;
    }, rs.allocUnsafe = function(e) {
        return ss(null, e);
    }, rs.allocUnsafeSlow = function(e) {
        return ss(null, e);
    }, rs.isBuffer = function(e) {
        return null != e && (!!e._isBuffer || Os(e) || "function" == typeof (t = e).readFloatLE && "function" == typeof t.slice && Os(t.slice(0, 0)));
        var t;
    }, rs.compare = function(e, t) {
        if (!cs(e) || !cs(t)) throw new TypeError("Arguments must be Buffers");
        if (e === t) return 0;
        for (var n = e.length, r = t.length, o = 0, i = Math.min(n, r); o < i; ++o) if (e[o] !== t[o]) {
            n = e[o], r = t[o];
            break;
        }
        return n < r ? -1 : r < n ? 1 : 0;
    }, rs.isEncoding = function(e) {
        switch (String(e).toLowerCase()) {
          case "hex":
          case "utf8":
          case "utf-8":
          case "ascii":
          case "latin1":
          case "binary":
          case "base64":
          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
            return 1;

          default:
            return 0;
        }
    }, rs.concat = function(e, t) {
        if (!es(e)) throw new TypeError('"list" argument must be an Array of Buffers');
        if (0 === e.length) return rs.alloc(0);
        var n;
        if (void 0 === t) for (n = t = 0; n < e.length; ++n) t += e[n].length;
        var r = rs.allocUnsafe(t), o = 0;
        for (n = 0; n < e.length; ++n) {
            var i = e[n];
            if (!cs(i)) throw new TypeError('"list" argument must be an Array of Buffers');
            i.copy(r, o), o += i.length;
        }
        return r;
    }, rs.byteLength = ls, rs.prototype._isBuffer = 1, rs.prototype.swap16 = function() {
        var e = this.length;
        if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
        for (var t = 0; t < e; t += 2) ps(this, t, t + 1);
        return this;
    }, rs.prototype.swap32 = function() {
        var e = this.length;
        if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
        for (var t = 0; t < e; t += 4) ps(this, t, t + 3), ps(this, t + 1, t + 2);
        return this;
    }, rs.prototype.swap64 = function() {
        var e = this.length;
        if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
        for (var t = 0; t < e; t += 8) ps(this, t, t + 7), ps(this, t + 1, t + 6), ps(this, t + 2, t + 5), 
        ps(this, t + 3, t + 4);
        return this;
    }, rs.prototype.toString = function() {
        var e = 0 | this.length;
        return 0 === e ? "" : 0 === arguments.length ? ms(this, 0, e) : function(e, t, n) {
            var r, o, i, s = 0;
            if ((void 0 === t || t < 0) && (t = 0), t > this.length) return "";
            if ((void 0 === n || n > this.length) && (n = this.length), n <= 0) return "";
            if ((n >>>= 0) <= (t >>>= 0)) return "";
            for (e || (e = "utf8"); ;) switch (e) {
              case "hex":
                return Is(this, t, n);

              case "utf8":
              case "utf-8":
                return ms(this, t, n);

              case "ascii":
                return vs(this, t, n);

              case "latin1":
              case "binary":
                return _s(this, t, n);

              case "base64":
                return r = this, i = n, 0 === (o = t) && i === r.length ? Xi(r) : Xi(r.slice(o, i));

              case "ucs2":
              case "ucs-2":
              case "utf16le":
              case "utf-16le":
                return Cs(this, t, n);

              default:
                if (s) throw new TypeError("Unknown encoding: " + e);
                e = (e + "").toLowerCase(), s = 1;
            }
        }.apply(this, arguments);
    }, rs.prototype.equals = function(e) {
        if (!cs(e)) throw new TypeError("Argument must be a Buffer");
        return this === e ? 1 : 0 === rs.compare(this, e);
    }, rs.prototype.inspect = function() {
        var e = "";
        return 0 < this.length && (e = this.toString("hex", 0, 50).match(/.{2}/g).join(" "), 
        50 < this.length && (e += " ... ")), "<Buffer " + e + ">";
    }, rs.prototype.compare = function(e, t, n, r, o) {
        if (!cs(e)) throw new TypeError("Argument must be a Buffer");
        if (void 0 === t && (t = 0), void 0 === n && (n = e ? e.length : 0), void 0 === r && (r = 0), 
        void 0 === o && (o = this.length), t < 0 || n > e.length || r < 0 || o > this.length) throw new RangeError("out of range index");
        if (o <= r && n <= t) return 0;
        if (o <= r) return -1;
        if (n <= t) return 1;
        if (this === e) return 0;
        for (var i = (o >>>= 0) - (r >>>= 0), s = (n >>>= 0) - (t >>>= 0), a = Math.min(i, s), u = this.slice(r, o), c = e.slice(t, n), l = 0; l < a; ++l) if (u[l] !== c[l]) {
            i = u[l], s = c[l];
            break;
        }
        return i < s ? -1 : s < i ? 1 : 0;
    }, rs.prototype.includes = function(e, t, n) {
        return -1 !== this.indexOf(e, t, n);
    }, rs.prototype.indexOf = function(e, t, n) {
        return hs(this, e, t, n, 1);
    }, rs.prototype.lastIndexOf = function(e, t, n) {
        return hs(this, e, t, n, 0);
    }, rs.prototype.write = function(e, t, n, r) {
        if (void 0 === t) r = "utf8", n = this.length, t = 0; else if (void 0 === n && "string" == typeof t) r = t, 
        n = this.length, t = 0; else {
            if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
            t |= 0, isFinite(n) ? (n |= 0, void 0 === r && (r = "utf8")) : (r = n, n = void 0);
        }
        var o, i, s, a, u, c, l, p, h, f = this.length - t;
        if ((void 0 === n || f < n) && (n = f), 0 < e.length && (n < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
        r || (r = "utf8");
        for (var g = 0; ;) switch (r) {
          case "hex":
            return gs(this, e, t, n);

          case "utf8":
          case "utf-8":
            return p = t, h = n, Ps(Ls(e, (l = this).length - p), l, p, h);

          case "ascii":
            return ds(this, e, t, n);

          case "latin1":
          case "binary":
            return ds(this, e, t, n);

          case "base64":
            return a = this, u = t, c = n, Ps(Rs(e), a, u, c);

          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
            return i = t, s = n, Ps(function(e, t) {
                for (var n, r, o, i = [], s = 0; s < e.length && !((t -= 2) < 0); ++s) r = (n = e.charCodeAt(s)) >> 8, 
                o = n % 256, i.push(o), i.push(r);
                return i;
            }(e, (o = this).length - i), o, i, s);

          default:
            if (g) throw new TypeError("Unknown encoding: " + r);
            r = ("" + r).toLowerCase(), g = 1;
        }
    }, rs.prototype.toJSON = function() {
        return {
            type: "Buffer",
            data: Array.prototype.slice.call(this._arr || this, 0)
        };
    };
    var ys = 4096;
    function vs(e, t, n) {
        var r = "";
        n = Math.min(e.length, n);
        for (var o = t; o < n; ++o) r += String.fromCharCode(127 & e[o]);
        return r;
    }
    function _s(e, t, n) {
        var r = "";
        n = Math.min(e.length, n);
        for (var o = t; o < n; ++o) r += String.fromCharCode(e[o]);
        return r;
    }
    function Is(e, t, n) {
        var r, o = e.length;
        (!t || t < 0) && (t = 0), (!n || n < 0 || o < n) && (n = o);
        for (var i = "", s = t; s < n; ++s) i += (r = e[s]) < 16 ? "0" + r.toString(16) : r.toString(16);
        return i;
    }
    function Cs(e, t, n) {
        for (var r = e.slice(t, n), o = "", i = 0; i < r.length; i += 2) o += String.fromCharCode(r[i] + 256 * r[i + 1]);
        return o;
    }
    function Ms(e, t, n) {
        if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
        if (n < e + t) throw new RangeError("Trying to access beyond buffer length");
    }
    function Ds(e, t, n, r, o, i) {
        if (!cs(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
        if (o < t || t < i) throw new RangeError('"value" argument is out of bounds');
        if (n + r > e.length) throw new RangeError("Index out of range");
    }
    function Ss(e, t, n, r) {
        t < 0 && (t = 65535 + t + 1);
        for (var o = 0, i = Math.min(e.length - n, 2); o < i; ++o) e[n + o] = (t & 255 << 8 * (r ? o : 1 - o)) >>> 8 * (r ? o : 1 - o);
    }
    function ks(e, t, n, r) {
        t < 0 && (t = 4294967295 + t + 1);
        for (var o = 0, i = Math.min(e.length - n, 4); o < i; ++o) e[n + o] = t >>> 8 * (r ? o : 3 - o) & 255;
    }
    function Ts(e, t, n, r, o, i) {
        if (n + r > e.length) throw new RangeError("Index out of range");
        if (n < 0) throw new RangeError("Index out of range");
    }
    function Es(e, t, n, r, o) {
        return o || Ts(e, 0, n, 4), Qi(e, t, n, r, 23, 4), n + 4;
    }
    function As(e, t, n, r, o) {
        return o || Ts(e, 0, n, 8), Qi(e, t, n, r, 52, 8), n + 8;
    }
    rs.prototype.slice = function(e, t) {
        var n, r = this.length;
        if ((e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : r < e && (e = r), (t = void 0 === t ? r : ~~t) < 0 ? (t += r) < 0 && (t = 0) : r < t && (t = r), 
        t < e && (t = e), rs.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)).__proto__ = rs.prototype; else {
            var o = t - e;
            n = new rs(o, void 0);
            for (var i = 0; i < o; ++i) n[i] = this[i + e];
        }
        return n;
    }, rs.prototype.readUIntLE = function(e, t, n) {
        e |= 0, t |= 0, n || Ms(e, t, this.length);
        for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) r += this[e + i] * o;
        return r;
    }, rs.prototype.readUIntBE = function(e, t, n) {
        e |= 0, t |= 0, n || Ms(e, t, this.length);
        for (var r = this[e + --t], o = 1; 0 < t && (o *= 256); ) r += this[e + --t] * o;
        return r;
    }, rs.prototype.readUInt8 = function(e, t) {
        return t || Ms(e, 1, this.length), this[e];
    }, rs.prototype.readUInt16LE = function(e, t) {
        return t || Ms(e, 2, this.length), this[e] | this[e + 1] << 8;
    }, rs.prototype.readUInt16BE = function(e, t) {
        return t || Ms(e, 2, this.length), this[e] << 8 | this[e + 1];
    }, rs.prototype.readUInt32LE = function(e, t) {
        return t || Ms(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3];
    }, rs.prototype.readUInt32BE = function(e, t) {
        return t || Ms(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
    }, rs.prototype.readIntLE = function(e, t, n) {
        e |= 0, t |= 0, n || Ms(e, t, this.length);
        for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) r += this[e + i] * o;
        return r >= (o *= 128) && (r -= Math.pow(2, 8 * t)), r;
    }, rs.prototype.readIntBE = function(e, t, n) {
        e |= 0, t |= 0, n || Ms(e, t, this.length);
        for (var r = t, o = 1, i = this[e + --r]; 0 < r && (o *= 256); ) i += this[e + --r] * o;
        return i >= (o *= 128) && (i -= Math.pow(2, 8 * t)), i;
    }, rs.prototype.readInt8 = function(e, t) {
        return t || Ms(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
    }, rs.prototype.readInt16LE = function(e, t) {
        t || Ms(e, 2, this.length);
        var n = this[e] | this[e + 1] << 8;
        return 32768 & n ? 4294901760 | n : n;
    }, rs.prototype.readInt16BE = function(e, t) {
        t || Ms(e, 2, this.length);
        var n = this[e + 1] | this[e] << 8;
        return 32768 & n ? 4294901760 | n : n;
    }, rs.prototype.readInt32LE = function(e, t) {
        return t || Ms(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
    }, rs.prototype.readInt32BE = function(e, t) {
        return t || Ms(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
    }, rs.prototype.readFloatLE = function(e, t) {
        return t || Ms(e, 4, this.length), Ji(this, e, 1, 23, 4);
    }, rs.prototype.readFloatBE = function(e, t) {
        return t || Ms(e, 4, this.length), Ji(this, e, 0, 23, 4);
    }, rs.prototype.readDoubleLE = function(e, t) {
        return t || Ms(e, 8, this.length), Ji(this, e, 1, 52, 8);
    }, rs.prototype.readDoubleBE = function(e, t) {
        return t || Ms(e, 8, this.length), Ji(this, e, 0, 52, 8);
    }, rs.prototype.writeUIntLE = function(e, t, n, r) {
        e = +e, t |= 0, n |= 0, r || Ds(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
        var o = 1, i = 0;
        for (this[t] = 255 & e; ++i < n && (o *= 256); ) this[t + i] = e / o & 255;
        return t + n;
    }, rs.prototype.writeUIntBE = function(e, t, n, r) {
        e = +e, t |= 0, n |= 0, r || Ds(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
        var o = n - 1, i = 1;
        for (this[t + o] = 255 & e; 0 <= --o && (i *= 256); ) this[t + o] = e / i & 255;
        return t + n;
    }, rs.prototype.writeUInt8 = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 1, 255, 0), rs.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), 
        this[t] = 255 & e, t + 1;
    }, rs.prototype.writeUInt16LE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 2, 65535, 0), rs.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, 
        this[t + 1] = e >>> 8) : Ss(this, e, t, 1), t + 2;
    }, rs.prototype.writeUInt16BE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 2, 65535, 0), rs.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, 
        this[t + 1] = 255 & e) : Ss(this, e, t, 0), t + 2;
    }, rs.prototype.writeUInt32LE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 4, 4294967295, 0), rs.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, 
        this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : ks(this, e, t, 1), 
        t + 4;
    }, rs.prototype.writeUInt32BE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 4, 4294967295, 0), rs.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, 
        this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : ks(this, e, t, 0), 
        t + 4;
    }, rs.prototype.writeIntLE = function(e, t, n, r) {
        if (e = +e, t |= 0, !r) {
            var o = Math.pow(2, 8 * n - 1);
            Ds(this, e, t, n, o - 1, -o);
        }
        var i = 0, s = 1, a = 0;
        for (this[t] = 255 & e; ++i < n && (s *= 256); ) e < 0 && 0 === a && 0 !== this[t + i - 1] && (a = 1), 
        this[t + i] = (e / s >> 0) - a & 255;
        return t + n;
    }, rs.prototype.writeIntBE = function(e, t, n, r) {
        if (e = +e, t |= 0, !r) {
            var o = Math.pow(2, 8 * n - 1);
            Ds(this, e, t, n, o - 1, -o);
        }
        var i = n - 1, s = 1, a = 0;
        for (this[t + i] = 255 & e; 0 <= --i && (s *= 256); ) e < 0 && 0 === a && 0 !== this[t + i + 1] && (a = 1), 
        this[t + i] = (e / s >> 0) - a & 255;
        return t + n;
    }, rs.prototype.writeInt8 = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 1, 127, -128), rs.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), 
        e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1;
    }, rs.prototype.writeInt16LE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 2, 32767, -32768), rs.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, 
        this[t + 1] = e >>> 8) : Ss(this, e, t, 1), t + 2;
    }, rs.prototype.writeInt16BE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 2, 32767, -32768), rs.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, 
        this[t + 1] = 255 & e) : Ss(this, e, t, 0), t + 2;
    }, rs.prototype.writeInt32LE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 4, 2147483647, -2147483648), rs.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, 
        this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : ks(this, e, t, 1), 
        t + 4;
    }, rs.prototype.writeInt32BE = function(e, t, n) {
        return e = +e, t |= 0, n || Ds(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), 
        rs.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, 
        this[t + 3] = 255 & e) : ks(this, e, t, 0), t + 4;
    }, rs.prototype.writeFloatLE = function(e, t, n) {
        return Es(this, e, t, 1, n);
    }, rs.prototype.writeFloatBE = function(e, t, n) {
        return Es(this, e, t, 0, n);
    }, rs.prototype.writeDoubleLE = function(e, t, n) {
        return As(this, e, t, 1, n);
    }, rs.prototype.writeDoubleBE = function(e, t, n) {
        return As(this, e, t, 0, n);
    }, rs.prototype.copy = function(e, t, n, r) {
        if (n || (n = 0), r || 0 === r || (r = this.length), t >= e.length && (t = e.length), 
        t || (t = 0), 0 < r && r < n && (r = n), r === n) return 0;
        if (0 === e.length || 0 === this.length) return 0;
        if (t < 0) throw new RangeError("targetStart out of bounds");
        if (n < 0 || n >= this.length) throw new RangeError("sourceStart out of bounds");
        if (r < 0) throw new RangeError("sourceEnd out of bounds");
        r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n);
        var o, i = r - n;
        if (this === e && n < t && t < r) for (o = i - 1; 0 <= o; --o) e[o + t] = this[o + n]; else if (i < 1e3 || !rs.TYPED_ARRAY_SUPPORT) for (o = 0; o < i; ++o) e[o + t] = this[o + n]; else Uint8Array.prototype.set.call(e, this.subarray(n, n + i), t);
        return i;
    }, rs.prototype.fill = function(e, t, n, r) {
        if ("string" == typeof e) {
            if ("string" == typeof t ? (r = t, t = 0, n = this.length) : "string" == typeof n && (r = n, 
            n = this.length), 1 === e.length) {
                var o = e.charCodeAt(0);
                o < 256 && (e = o);
            }
            if (void 0 !== r && "string" != typeof r) throw new TypeError("encoding must be a string");
            if ("string" == typeof r && !rs.isEncoding(r)) throw new TypeError("Unknown encoding: " + r);
        } else "number" == typeof e && (e &= 255);
        if (t < 0 || this.length < t || this.length < n) throw new RangeError("Out of range index");
        if (n <= t) return this;
        var i;
        if (t >>>= 0, n = void 0 === n ? this.length : n >>> 0, e || (e = 0), "number" == typeof e) for (i = t; i < n; ++i) this[i] = e; else {
            var s = cs(e) ? e : Ls(new rs(e, r).toString()), a = s.length;
            for (i = 0; i < n - t; ++i) this[i + t] = s[i % a];
        }
        return this;
    };
    var ws = /[^+\/0-9A-Za-z-_]/g;
    function Ls(e, t) {
        var n;
        t = t || 1 / 0;
        for (var r = e.length, o = null, i = [], s = 0; s < r; ++s) {
            if (55295 < (n = e.charCodeAt(s)) && n < 57344) {
                if (!o) {
                    if (56319 < n) {
                        -1 < (t -= 3) && i.push(239, 191, 189);
                        continue;
                    }
                    if (s + 1 === r) {
                        -1 < (t -= 3) && i.push(239, 191, 189);
                        continue;
                    }
                    o = n;
                    continue;
                }
                if (n < 56320) {
                    -1 < (t -= 3) && i.push(239, 191, 189), o = n;
                    continue;
                }
                n = 65536 + (o - 55296 << 10 | n - 56320);
            } else o && -1 < (t -= 3) && i.push(239, 191, 189);
            if (o = null, n < 128) {
                if ((t -= 1) < 0) break;
                i.push(n);
            } else if (n < 2048) {
                if ((t -= 2) < 0) break;
                i.push(n >> 6 | 192, 63 & n | 128);
            } else if (n < 65536) {
                if ((t -= 3) < 0) break;
                i.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128);
            } else {
                if (!(n < 1114112)) throw new Error("Invalid code point");
                if ((t -= 4) < 0) break;
                i.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128);
            }
        }
        return i;
    }
    function Rs(e) {
        return function(e) {
            var t, n, r, o, i, s;
            zi || Yi();
            var a = e.length;
            if (0 < a % 4) throw new Error("Invalid string. Length must be a multiple of 4");
            i = "=" === e[a - 2] ? 2 : "=" === e[a - 1] ? 1 : 0, s = new $i(3 * a / 4 - i), 
            r = 0 < i ? a - 4 : a;
            var u = 0;
            for (n = t = 0; t < r; t += 4, n += 3) o = Ki[e.charCodeAt(t)] << 18 | Ki[e.charCodeAt(t + 1)] << 12 | Ki[e.charCodeAt(t + 2)] << 6 | Ki[e.charCodeAt(t + 3)], 
            s[u++] = o >> 16 & 255, s[u++] = o >> 8 & 255, s[u++] = 255 & o;
            return 2 === i ? (o = Ki[e.charCodeAt(t)] << 2 | Ki[e.charCodeAt(t + 1)] >> 4, s[u++] = 255 & o) : 1 === i && (o = Ki[e.charCodeAt(t)] << 10 | Ki[e.charCodeAt(t + 1)] << 4 | Ki[e.charCodeAt(t + 2)] >> 2, 
            s[u++] = o >> 8 & 255, s[u++] = 255 & o), s;
        }(function(e) {
            if ((e = (t = e, t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")).replace(ws, "")).length < 2) return "";
            for (var t; e.length % 4 != 0; ) e += "=";
            return e;
        }(e));
    }
    function Ps(e, t, n, r) {
        for (var o = 0; o < r && !(o + n >= t.length || o >= e.length); ++o) t[o + n] = e[o];
        return o;
    }
    function Os(e) {
        return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
    }
    var bs = function(e) {
        function t() {
            var e;
            return a(this, t), (e = g(this, c(t).call(this))).retry = 2, e._request = e.promisify(wx.request), 
            e;
        }
        return u(t, Hi), i(t, [ {
            key: "request",
            value: function(e) {
                return this._checkOptions(e), this._initOptions(e), e = H({}, e, {
                    responseType: "text"
                }), this._requestWithRetry(e);
            }
        }, {
            key: "_requestWithRetry",
            value: function(t) {
                var n = this, r = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0;
                return this._request(t).then(this._handleResolve).catch(function(e) {
                    if (J(e.errMsg)) {
                        if (e.errMsg.includes("abort")) return oo({});
                        if (e.errMsg.includes("timeout")) return 0 < n.retry && r < n.retry ? n._requestWithRetry(t, ++r) : io(new qn({
                            code: St,
                            message: e.errMsg
                        }));
                        if (e.errMsg.includes("fail")) return 0 < n.retry && r < n.retry ? n._requestWithRetry(t, ++r) : io(new qn({
                            code: Dt,
                            message: e.errMsg
                        }));
                    }
                    return io(new qn(H({
                        code: Pt,
                        message: e.message
                    }, e)));
                });
            }
        }, {
            key: "_handleResolve",
            value: function(e) {
                var t = e.data, n = t.error_code, r = t.ErrorCode;
                return "number" == typeof n && (r = n), r !== Br.SUCCESS && (e.data.ErrorCode = Number("".concat(r))), 
                e;
            }
        }, {
            key: "promisify",
            value: function(o) {
                return function(r) {
                    return new Promise(function(e, t) {
                        var n = o(Object.assign({}, r, {
                            success: e,
                            fail: t
                        }));
                        r.updateAbort && r.updateAbort(function() {
                            n && re(n.abort) && n.abort();
                        });
                    });
                };
            }
        } ]), t;
    }(), Ns = function() {
        function e() {
            a(this, e), this.request = 0, this.success = 0, this.fail = 0, this.reportRate = 10, 
            this.requestTimeCost = [];
        }
        return i(e, [ {
            key: "report",
            value: function() {
                if (1 !== this.request) {
                    if (this.request % this.reportRate != 0) return null;
                    var e = this.avgRequestTime(), t = "runLoop reports: success=".concat(this.success, ",fail=").concat(this.fail, ",total=").concat(this.request, ",avg=").concat(e, ",cur=").concat(this.requestTimeCost[this.requestTimeCost.length - 1], ",max=").concat(Math.max.apply(null, this.requestTimeCost), ",min=").concat(Math.min.apply(null, this.requestTimeCost));
                    $.log(t);
                }
            }
        }, {
            key: "setRequestTime",
            value: function(e, t) {
                var n = Math.abs(t - e);
                100 === this.requestTimeCost.length && this.requestTimeCost.shift(), this.requestTimeCost.push(n);
            }
        }, {
            key: "avgRequestTime",
            value: function() {
                for (var e, t = this.requestTimeCost.length, n = 0, r = 0; r < t; r++) n += this.requestTimeCost[r];
                return e = n / t, Math.round(100 * e) / 100;
            }
        } ]), e;
    }(), Gs = Fi.CancelToken, Us = function() {
        function t(e) {
            a(this, t), this._initializeOptions(e), this._initializeMembers(), this.status = new Ns();
        }
        return i(t, [ {
            key: "destructor",
            value: function() {
                clearTimeout(this._seedID);
                var e = this._index();
                for (var t in this) Object.prototype.hasOwnProperty.call(this, t) && (this[t] = null);
                return e;
            }
        }, {
            key: "setIndex",
            value: function(e) {
                this._index = e;
            }
        }, {
            key: "getIndex",
            value: function() {
                return this._index;
            }
        }, {
            key: "isRunning",
            value: function() {
                return !this._stoped;
            }
        }, {
            key: "_initializeOptions",
            value: function(e) {
                this.options = e;
            }
        }, {
            key: "_initializeMembers",
            value: function() {
                this._index = -1, this._seedID = 0, this._requestStatus = 0, this._stoped = 0, this._intervalTime = 0, 
                this._intervalIncreaseStep = 1e3, this._intervalDecreaseStep = 1e3, this._intervalTimeMax = 5e3, 
                this._protectTimeout = 3e3, this._getNoticeSeq = this.options.getNoticeSeq, this._retryCount = 0, 
                this._responseTime = Date.now(), this._responseTimeThreshold = 2e3, this.requestor = Bi, 
                this.abort = null;
            }
        }, {
            key: "start",
            value: function() {
                0 === this._seedID ? (this._stoped = 0, this._send()) : $.log('XHRRunLoop.start(), XHRRunLoop is running now, if you want to restart runLoop , please run "stop()" first.');
            }
        }, {
            key: "_reset",
            value: function() {
                $.log("XHRRunLoop._reset(), reset long poll _intervalTime", this._intervalTime), 
                this.stop(), this.start();
            }
        }, {
            key: "_intervalTimeIncrease",
            value: function() {
                this._intervalTime !== this._responseTimeThreshold && (this._intervalTime < this._responseTimeThreshold && (this._intervalTime += this._intervalIncreaseStep), 
                this._intervalTime > this._responseTimeThreshold && (this._intervalTime = this._responseTimeThreshold));
            }
        }, {
            key: "_intervalTimeDecrease",
            value: function() {
                0 !== this._intervalTime && (0 < this._intervalTime && (this._intervalTime -= this._intervalDecreaseStep), 
                this._intervalTime < 0 && (this._intervalTime = 0));
            }
        }, {
            key: "_intervalTimeAdjustment",
            value: function() {
                var e = Date.now();
                100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold ? this._intervalTimeIncrease() : this._intervalTimeDecrease(), 
                this._responseTime = e;
            }
        }, {
            key: "_intervalTimeAdjustmentBaseOnResponseData",
            value: function(e) {
                e.ErrorCode === Br.SUCCESS ? this._intervalTimeDecrease() : this._intervalTimeIncrease();
            }
        }, {
            key: "_send",
            value: function() {
                var t = this;
                if (1 != this._requestStatus) {
                    this._requestStatus = 1, this.status.request++, "function" == typeof this.options.before && this.options.before(this.options.pack.requestData);
                    var n = Date.now(), r = 0;
                    this.requestor.request({
                        url: this.options.pack.getUrl(),
                        data: this.options.pack.requestData,
                        method: this.options.pack.method,
                        cancelToken: new Gs(function(e) {
                            t.abort = e;
                        })
                    }).then(function(e) {
                        if (t._intervalTimeAdjustmentBaseOnResponseData.bind(t)(e.data), 0 < t._retryCount && (t._retryCount = 0), 
                        t.status.success++, r = Date.now(), t.status.setRequestTime(n, r), e.data.timecost = r - n, 
                        "function" == typeof t.options.success) try {
                            t.options.success({
                                pack: t.options.pack,
                                error: 0,
                                data: t.options.pack.callback(e.data)
                            });
                        } catch (e) {
                            $.warn("XHRRunLoop._send(), error:", e);
                        }
                        (t._requestStatus = 0) == t._stoped && (t._seedID = setTimeout(t._send.bind(t), t._intervalTime)), 
                        t.status.report();
                    }).catch(function(e) {
                        if (t.status.fail++, t._retryCount++, t._intervalTimeAdjustment.bind(t)(), 0 == t._stoped && (t._seedID = setTimeout(t._send.bind(t), t._intervalTime)), 
                        t._requestStatus = 0, "function" == typeof t.options.fail && void 0 !== e.request) try {
                            t.options.fail({
                                pack: t.options.pack,
                                error: e,
                                data: 0
                            });
                        } catch (e) {
                            $.warn("XHRRunLoop._send(), fail callback error:"), $.error(e);
                        }
                        r = Date.now(), t.status.setRequestTime(n, r), t.status.report();
                    });
                }
            }
        }, {
            key: "stop",
            value: function() {
                this._clearAllTimeOut(), this._stoped = 1;
            }
        }, {
            key: "_clearAllTimeOut",
            value: function() {
                clearTimeout(this._seedID), this._seedID = 0;
            }
        } ]), t;
    }(), qs = function() {
        function t(e) {
            a(this, t), this._initializeOptions(e), this._initializeMembers(), this.status = new Ns();
        }
        return i(t, [ {
            key: "destructor",
            value: function() {
                clearTimeout(this._seedID);
                var e = this._index();
                for (var t in this) Object.prototype.hasOwnProperty.call(this, t) && (this[t] = null);
                return e;
            }
        }, {
            key: "setIndex",
            value: function(e) {
                this._index = e;
            }
        }, {
            key: "isRunning",
            value: function() {
                return !this._stoped;
            }
        }, {
            key: "getIndex",
            value: function() {
                return this._index;
            }
        }, {
            key: "_initializeOptions",
            value: function(e) {
                this.options = e;
            }
        }, {
            key: "_initializeMembers",
            value: function() {
                this._index = -1, this._seedID = 0, this._requestStatus = 0, this._stoped = 0, this._intervalTime = 0, 
                this._intervalIncreaseStep = 1e3, this._intervalDecreaseStep = 1e3, this._intervalTimeMax = 5e3, 
                this._protectTimeout = 3e3, this._getNoticeSeq = this.options.getNoticeSeq, this._retryCount = 0, 
                this._responseTime = Date.now(), this._responseTimeThreshold = 2e3, this.requestor = new bs(), 
                this.abort = null;
            }
        }, {
            key: "start",
            value: function() {
                0 === this._seedID ? (this._stoped = 0, this._send()) : $.log('WXRunLoop.start(): WXRunLoop is running now, if you want to restart runLoop , please run "stop()" first.');
            }
        }, {
            key: "_reset",
            value: function() {
                $.log("WXRunLoop.reset(), long poll _intervalMaxRate", this._intervalMaxRate), this.stop(), 
                this.start();
            }
        }, {
            key: "_intervalTimeIncrease",
            value: function() {
                this._intervalTime !== this._responseTimeThreshold && (this._intervalTime < this._responseTimeThreshold && (this._intervalTime += this._intervalIncreaseStep), 
                this._intervalTime > this._responseTimeThreshold && (this._intervalTime = this._responseTimeThreshold));
            }
        }, {
            key: "_intervalTimeDecrease",
            value: function() {
                0 !== this._intervalTime && (0 < this._intervalTime && (this._intervalTime -= this._intervalDecreaseStep), 
                this._intervalTime < 0 && (this._intervalTime = 0));
            }
        }, {
            key: "_intervalTimeAdjustment",
            value: function() {
                var e = Date.now();
                100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold ? this._intervalTimeIncrease() : this._intervalTimeDecrease(), 
                this._responseTime = e;
            }
        }, {
            key: "_intervalTimeAdjustmentBaseOnResponseData",
            value: function(e) {
                e.ErrorCode === Br.SUCCESS ? this._intervalTimeDecrease() : this._intervalTimeIncrease();
            }
        }, {
            key: "_send",
            value: function() {
                var t = this;
                if (1 != this._requestStatus) {
                    var n = this;
                    this._requestStatus = 1, this.status.request++, "function" == typeof this.options.before && this.options.before(n.options.pack.requestData);
                    var r = Date.now(), o = 0;
                    this.requestor.request({
                        url: n.options.pack.getUrl(),
                        data: n.options.pack.requestData,
                        method: n.options.pack.method,
                        updateAbort: function(e) {
                            t.abort = e;
                        }
                    }).then(function(e) {
                        if (n._intervalTimeAdjustmentBaseOnResponseData.bind(t)(e.data), 0 < n._retryCount && (n._retryCount = 0), 
                        t.status.success++, o = Date.now(), t.status.setRequestTime(r, o), e.data.timecost = o - r, 
                        "function" == typeof n.options.success) try {
                            t.options.success({
                                pack: t.options.pack,
                                error: 0,
                                data: t.options.pack.callback(e.data)
                            });
                        } catch (e) {
                            $.warn("WXRunLoop._send(), error:", e);
                        }
                        (n._requestStatus = 0) == n._stoped && (n._seedID = setTimeout(n._send.bind(n), n._intervalTime)), 
                        t.status.report();
                    }).catch(function(e) {
                        if (t.status.fail++, n._retryCount++, n._intervalTimeAdjustment.bind(t)(), 0 == n._stoped && (n._seedID = setTimeout(n._send.bind(n), n._intervalTime)), 
                        n._requestStatus = 0, "function" == typeof n.options.fail) try {
                            t.options.fail({
                                pack: t.options.pack,
                                error: e,
                                data: 0
                            });
                        } catch (e) {
                            $.warn("WXRunLoop._send(), fail callback error:"), $.error(e);
                        }
                        o = Date.now(), t.status.setRequestTime(r, o), t.status.report();
                    });
                }
            }
        }, {
            key: "stop",
            value: function() {
                this._clearAllTimeOut(), this._stoped = 1;
            }
        }, {
            key: "_clearAllTimeOut",
            value: function() {
                clearTimeout(this._seedID), this._seedID = 0;
            }
        } ]), t;
    }(), xs = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).context = e.context, t.httpConnection = t._getHttpconnection(), 
            t.keepAliveConnections = [], t;
        }
        return u(n, Yr), i(n, [ {
            key: "initializeListener",
            value: function() {
                this.tim.innerEmitter.on(Tr, this._stopAllRunLoop, this);
            }
        }, {
            key: "request",
            value: function(t) {
                var e = {
                    url: t.url,
                    data: t.requestData,
                    method: t.method,
                    callback: t.callback
                };
                return this.httpConnection.request(e).then(function(e) {
                    return e.data = t.callback(e.data), e.data.errorCode !== Br.SUCCESS ? io(new qn({
                        code: e.data.errorCode,
                        message: e.data.errorInfo
                    })) : e;
                });
            }
        }, {
            key: "createRunLoop",
            value: function(e) {
                var t = this.createKeepAliveConnection(e);
                return t.setIndex(this.keepAliveConnections.push(t) - 1), t;
            }
        }, {
            key: "stopRunLoop",
            value: function(e) {
                e.stop();
            }
        }, {
            key: "_stopAllRunLoop",
            value: function() {
                for (var e = this.keepAliveConnections.length, t = 0; t < e; t++) this.keepAliveConnections[t].stop();
            }
        }, {
            key: "destroyRunLoop",
            value: function(e) {
                e.stop();
                var t = e.destructor();
                this.keepAliveConnections.slice(t, 1);
            }
        }, {
            key: "startRunLoopExclusive",
            value: function(e) {
                for (var t = e.getIndex(), n = 0; n < this.keepAliveConnections.length; n++) n !== t && this.keepAliveConnections[n].stop();
                e.start();
            }
        }, {
            key: "_getHttpconnection",
            value: function() {
                return E ? new bs() : new ji();
            }
        }, {
            key: "createKeepAliveConnection",
            value: function(e) {
                return E ? new qs(e) : (2 === this.tim.options.runLoopNetType || (this.tim.options.runLoopNetType, 
                "function" == typeof window.WebSocket && window.WebSocket.prototype.send), new Us(e));
            }
        }, {
            key: "clearAll",
            value: function() {
                this.conn.cancelAll();
            }
        }, {
            key: "reset",
            value: function() {
                this.keepAliveConnections = [];
            }
        } ]), n;
    }();
    void 0 === console.table && (console.table = console.log);
    var Fs = function(e, t) {
        e.code ? $.warn("Oops! code: ".concat(e.code), "message: ".concat(e.message), "stack: ".concat(e.stack)) : $.warn("Oops! message: ".concat(e.message), "stack: ".concat(e.stack));
    }, Bs = {
        f9999998: function(e) {
            Fs(e);
        },
        f9999999: function(e) {
            Fs(e);
        },
        f: function(e) {
            Fs(e), "未定义的错误:".concat(e.code, " , ").concat(e.message);
        },
        f20000: function(e) {
            Fs(e);
        },
        f20001: function(e) {
            Fs(e);
        },
        f20002: function(e) {
            Fs(e);
        },
        f30000: function(e) {
            Fs(e);
        },
        f40004: function(e) {
            Fs(e);
        },
        f40005: function(e) {
            Fs(e);
        },
        f40006: function(e) {
            Fs(e);
        },
        f40007: function(e) {
            Fs(e);
        },
        f40008: function(e) {
            Fs(e);
        },
        f50070003: function(e) {
            e.code.replace("500", ""), Fs(e);
        },
        f50030001: function(e) {
            Fs(e);
        },
        f50070221: function(e) {
            Fs(e);
        }
    };
    Bs.echo = Fs;
    var Hs = function() {
        function t(e) {
            a(this, t), this.methods = Bs, this.tim = e, this._initielizeListener();
        }
        return i(t, [ {
            key: "_initielizeListener",
            value: function() {
                this.tim.innerEmitter.on(Ar, this._onErrorDetected, this);
            }
        }, {
            key: "ask",
            value: function(e) {
                var t = [ "f", e.code ].join(""), n = Bs.echo;
                this.methods.hasOwnProperty(t) ? this.methods[t](e) : n(e);
            }
        }, {
            key: "_onErrorDetected",
            value: function(e) {
                this.ask(e), this.tim.outerEmitter.emit(l.ERROR, e);
            }
        } ]), t;
    }(), js = [ "jpg", "jpeg", "gif", "png" ], Vs = [ "mp4" ], Ks = function() {
        function t(e) {
            a(this, t), ke(e) || (this.userID = e.userID || "", this.nick = e.nick || "", this.gender = e.gender || "", 
            this.birthday = e.birthday || 0, this.location = e.location || "", this.selfSignature = e.selfSignature || "", 
            this.allowType = e.allowType || B.ALLOW_TYPE_ALLOW_ANY, this.language = e.language || 0, 
            this.avatar = e.avatar || "", this.messageSettings = e.messageSettings || 0, this.adminForbidType = e.adminForbidType || B.FORBID_TYPE_NONE, 
            this.level = e.level || 0, this.role = e.role || 0, this.lastUpdatedTime = 0);
        }
        return i(t, [ {
            key: "validate",
            value: function(e) {
                var t = 1, n = "";
                for (var r in ke(e) && (t = 0, n = "empty options"), e) if (Object.prototype.hasOwnProperty.call(e, r)) {
                    if (ke(e[r]) && !J(e[r]) && !X(e[r])) {
                        n = "key:" + r + ", invalid value:" + e[r], t = 0;
                        continue;
                    }
                    switch (r) {
                      case "nick":
                        J(e[r]) || (n = "nick should be a string", t = 0), 500 < he(e[r]) && (n = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(he(e[r]), " bytes"), 
                        t = 0);
                        break;

                      case "gender":
                        me(Zr, e.gender) || (n = "key:gender, invalid value:" + e.gender, t = 0);
                        break;

                      case "birthday":
                        X(e.birthday) || (n = "birthday should be a number", t = 0);
                        break;

                      case "location":
                        J(e.location) || (n = "location should be a string", t = 0);
                        break;

                      case "selfSignature":
                        J(e.selfSignature) || (n = "selfSignature should be a string", t = 0);
                        break;

                      case "allowType":
                        me(to, e.allowType) || (n = "key:allowType, invalid value:" + e.allowType, t = 0);
                        break;

                      case "language":
                        X(e.language) || (n = "language should be a number", t = 0);
                        break;

                      case "avatar":
                        J(e.avatar) || (n = "avatar should be a string", t = 0);
                        break;

                      case "messageSettings":
                        0 !== e.messageSettings && 1 !== e.messageSettings && (n = "messageSettings should be 0 or 1", 
                        t = 0);
                        break;

                      case "adminForbidType":
                        me(eo, e.adminForbidType) || (n = "key:adminForbidType, invalid value:" + e.adminForbidType, 
                        t = 0);
                        break;

                      case "level":
                        X(e.level) || (n = "level should be a number", t = 0);
                        break;

                      case "role":
                        X(e.role) || (n = "role should be a number", t = 0);
                        break;

                      default:
                        n = "unknown key:" + r, t = 0;
                    }
                }
                return {
                    valid: t,
                    tips: n
                };
            }
        } ]), t;
    }(), $s = function() {
        function t(e) {
            a(this, t), this.uc = e, this.TAG = "profile", this.Actions = {
                Q: "query",
                U: "update"
            }, this.accountProfileMap = new Map(), this.expirationTime = 864e5;
        }
        return i(t, [ {
            key: "setExpirationTime",
            value: function(e) {
                this.expirationTime = e;
            }
        }, {
            key: "getUserProfile",
            value: function(e) {
                var r = this, t = this.uc.tim.connectionController, n = e.userIDList;
                if (!ee(n)) return $.error("ProfileHandler.getUserProfile options.userIDList 必需是数组"), 
                io({
                    code: vt,
                    message: kn
                });
                e.fromAccount = this.uc.getMyAccount(), 100 < n.length && ($.warn("ProfileHandler.getUserProfile 获取用户资料人数不能超过100人"), 
                n.length = 100);
                for (var o, i = [], s = [], a = 0, u = n.length; a < u; a++) o = n[a], this.uc.isMyFriend(o) && this._containsAccount(o) ? s.push(this._getProfileFromMap(o)) : i.push(o);
                if (0 === i.length) return oo(s);
                e.toAccount = i;
                var c = e.bFromGetMyProfile || 0, l = new go();
                l.setMethod(wo).setStart();
                var p = this.uc.makeCapsule(this.TAG, this.Actions.Q, e);
                return t.request(p).then(function(e) {
                    l.setCode(0).setNetworkType(r.uc.getNetworkType()).setText(e.data.userProfileItem.length).setEnd(), 
                    $.info("ProfileHandler.getUserProfile ok");
                    var t = r._handleResponse(e).concat(s);
                    return c ? (r.uc.onGotMyProfile(), new no(t[0])) : new no(t);
                }).catch(function(n) {
                    return r.uc.probeNetwork().then(function(e, t) {
                        l.setError(n, e, t).setEnd();
                    }), $.error("ProfileHandler.getUserProfile error:", n), io(n);
                });
            }
        }, {
            key: "getMyProfile",
            value: function() {
                var e = this.uc.getMyAccount();
                if ($.log("ProfileHandler.getMyProfile myAccount=" + e), this._fillMap(), this._containsAccount(e)) {
                    var t = this._getProfileFromMap(e);
                    return $.debug("ProfileHandler.getMyProfile from cache, myProfile:" + JSON.stringify(t)), 
                    this.uc.onGotMyProfile(), oo(t);
                }
                return this.getUserProfile({
                    fromAccount: e,
                    userIDList: [ e ],
                    bFromGetMyProfile: 1
                });
            }
        }, {
            key: "_handleResponse",
            value: function(e) {
                for (var t, n, r = ue.now(), o = e.data.userProfileItem, i = [], s = 0, a = o.length; s < a; s++) "@TLS#NOT_FOUND" !== o[s].to && "" !== o[s].to && (t = o[s].to, 
                n = this._updateMap(t, this._getLatestProfileFromResponse(t, o[s].profileItem)), 
                i.push(n));
                return $.log("ProfileHandler._handleResponse cost " + (ue.now() - r) + " ms"), i;
            }
        }, {
            key: "_getLatestProfileFromResponse",
            value: function(e, t) {
                var n = {};
                if (n.userID = e, !ke(t)) for (var r = 0, o = t.length; r < o; r++) switch (t[r].tag) {
                  case Qr.NICK:
                    n.nick = t[r].value;
                    break;

                  case Qr.GENDER:
                    n.gender = t[r].value;
                    break;

                  case Qr.BIRTHDAY:
                    n.birthday = t[r].value;
                    break;

                  case Qr.LOCATION:
                    n.location = t[r].value;
                    break;

                  case Qr.SELFSIGNATURE:
                    n.selfSignature = t[r].value;
                    break;

                  case Qr.ALLOWTYPE:
                    n.allowType = t[r].value;
                    break;

                  case Qr.LANGUAGE:
                    n.language = t[r].value;
                    break;

                  case Qr.AVATAR:
                    n.avatar = t[r].value;
                    break;

                  case Qr.MESSAGESETTINGS:
                    n.messageSettings = t[r].value;
                    break;

                  case Qr.ADMINFORBIDTYPE:
                    n.adminForbidType = t[r].value;
                    break;

                  case Qr.LEVEL:
                    n.level = t[r].value;
                    break;

                  case Qr.ROLE:
                    n.role = t[r].value;
                    break;

                  default:
                    $.warn("ProfileHandler._handleResponse unkown tag->", t[r].tag);
                }
                return n;
            }
        }, {
            key: "updateMyProfile",
            value: function(n) {
                var r = this, e = this.uc.tim, t = e.connectionController, o = e.outerEmitter, i = new Ks().validate(n);
                if (!i.valid) return $.error("ProfileHandler.updateMyProfile info:" + i.tips), io({
                    code: _t,
                    message: Tn
                });
                var s = [];
                for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && s.push({
                    tag: Qr[a.toUpperCase()],
                    value: n[a]
                });
                var u = this.uc.makeCapsule(this.TAG, this.Actions.U, {
                    fromAccount: this.uc.getMyAccount(),
                    profileItem: s
                });
                return t.request(u).then(function(e) {
                    $.info("ProfileHandler.updateMyProfile ok");
                    var t = r._updateMap(r.uc.getMyAccount(), n);
                    return o.emit(l.PROFILE_UPDATED, [ t ]), oo(t);
                }).catch(function(e) {
                    return $.error("ProfileHandler.updateMyProfile error:", e), io(e);
                });
            }
        }, {
            key: "onProfileModified",
            value: function(e) {
                var t = e.data;
                if (!ke(t)) {
                    var n, r, o = t.length;
                    $.info("ProfileHandler.onProfileModified length=" + o);
                    for (var i = [], s = 0; s < o; s++) n = t[s].userID, r = this._updateMap(n, this._getLatestProfileFromResponse(n, t[s].profileList)), 
                    i.push(r);
                    var a = this.uc.tim, u = a.innerEmitter, c = a.outerEmitter;
                    u.emit(Pr, {
                        data: i
                    }), c.emit(l.PROFILE_UPDATED, i);
                }
            }
        }, {
            key: "_fillMap",
            value: function() {
                if (0 === this.accountProfileMap.size) {
                    for (var e = this._getCachedProfiles(), t = Date.now(), n = 0, r = e.length; n < r; n++) t - e[n].lastUpdatedTime < this.expirationTime && this.accountProfileMap.set(e[n].userID, e[n]);
                    $.log("ProfileHandler._fillMap from chache, map.size=" + this.accountProfileMap.size);
                }
            }
        }, {
            key: "_updateMap",
            value: function(e, t) {
                var n, r = Date.now();
                return this._containsAccount(e) ? (n = this._getProfileFromMap(e), ce(n, t), n.lastUpdatedTime = r) : (n = new Ks(t), 
                (this.uc.isMyFriend(e) || e === this.uc.getMyAccount()) && (n.lastUpdatedTime = r, 
                this.accountProfileMap.set(e, n))), this._flushMap(e === this.uc.getMyAccount()), 
                n;
            }
        }, {
            key: "_flushMap",
            value: function(e) {
                var t = m(this.accountProfileMap.values()), n = this.uc.tim.storage;
                $.debug("ProfileHandler._flushMap length=".concat(t.length, " flushAtOnce=").concat(e)), 
                n.setItem(this.TAG, t, e);
            }
        }, {
            key: "_containsAccount",
            value: function(e) {
                return this.accountProfileMap.has(e);
            }
        }, {
            key: "_getProfileFromMap",
            value: function(e) {
                return this.accountProfileMap.get(e);
            }
        }, {
            key: "_getCachedProfiles",
            value: function() {
                var e = this.uc.tim.storage.getItem(this.TAG);
                return ke(e) ? [] : e;
            }
        }, {
            key: "onConversationsProfileUpdated",
            value: function(e) {
                for (var t, n, r, o = [], i = 0, s = e.length; i < s; i++) n = (t = e[i]).userID, 
                this.uc.isMyFriend(n) && (this._containsAccount(n) ? (r = this._getProfileFromMap(n), 
                0 < ce(r, t) && o.push(n)) : o.push(t.userID));
                0 !== o.length && ($.info("ProfileHandler.onConversationsProfileUpdated toAccount:", o), 
                this.getUserProfile({
                    userIDList: o
                }));
            }
        }, {
            key: "reset",
            value: function() {
                this._flushMap(1), this.accountProfileMap.clear();
            }
        } ]), t;
    }(), zs = function() {
        function t(e) {
            a(this, t), this.options = e ? e.options : {
                enablePointer: 1
            }, this.pointsList = {}, this.reportText = {}, this.maxNameLen = 0, this.gapChar = "-", 
            this.log = console.log, this.currentTask = "";
        }
        return i(t, [ {
            key: "newTask",
            value: function(e) {
                0 != this.options.enablePointer && (e || (e = [ "task", this._timeFormat() ].join("-")), 
                this.pointsList[e] = [], this.currentTask = e, console.log("Pointer new Task : ".concat(this.currentTask)));
            }
        }, {
            key: "deleteTask",
            value: function(e) {
                0 != this.options.enablePointer && (e || (e = this.currentTask), this.pointsList[e].length = 0, 
                delete this.pointsList[e]);
            }
        }, {
            key: "dot",
            value: function() {
                var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", t = 1 < arguments.length ? arguments[1] : void 0;
                if (0 != this.options.enablePointer) {
                    t = t || this.currentTask;
                    var n = +new Date();
                    this.maxNameLen = this.maxNameLen < e.length ? e.length : this.maxNameLen, this.flen = this.maxNameLen + 10, 
                    this.pointsList[t].push({
                        pointerName: e,
                        time: n
                    });
                }
            }
        }, {
            key: "_analisys",
            value: function(e) {
                if (0 != this.options.enablePointer) {
                    e = e || this.currentTask;
                    for (var t = this.pointsList[e], n = t.length, r = [], o = [], i = 0; i < n; i++) 0 !== i && (o = this._analisysTowPoints(t[i - 1], t[i]), 
                    r.push(o.join("")));
                    return o = this._analisysTowPoints(t[0], t[n - 1], 1), r.push(o.join("")), r.join("");
                }
            }
        }, {
            key: "_analisysTowPoints",
            value: function(e, t) {
                var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 0;
                if (0 != this.options.enablePointer) {
                    var r = this.flen, o = (t.time - e.time).toString(), i = e.pointerName + this.gapChar.repeat(r - e.pointerName.length), s = t.pointerName + this.gapChar.repeat(r - t.pointerName.length), a = this.gapChar.repeat(4 - o.length) + o;
                    return n ? [ "%c", i, s, a, "ms\n%c" ] : [ i, s, a, "ms\n" ];
                }
            }
        }, {
            key: "report",
            value: function(e) {
                if (0 != this.options.enablePointer) {
                    e = e || this.currentTask;
                    var t = this._analisys(e);
                    this.pointsList = [];
                    var n = this._timeFormat(), r = "Pointer[".concat(e, "(").concat(n, ")]"), o = 4 * this.maxNameLen, i = (o - r.length) / 2;
                    console.log([ "-".repeat(i), r, "-".repeat(i) ].join("")), console.log("%c" + t, "color:#66a", "color:red", "color:#66a"), 
                    console.log("-".repeat(o));
                }
            }
        }, {
            key: "_timeFormat",
            value: function() {
                var e = new Date(), t = this.zeroFix(e.getMonth() + 1, 2), n = this.zeroFix(e.getDate(), 2);
                return "".concat(t, "-").concat(n, " ").concat(e.getHours(), ":").concat(e.getSeconds(), ":").concat(e.getMinutes(), "~").concat(e.getMilliseconds());
            }
        }, {
            key: "zeroFix",
            value: function(e, t) {
                return ("000000000" + e).slice(-t);
            }
        }, {
            key: "reportAll",
            value: function() {
                if (0 != this.options.enablePointer) for (var e in this.pointsList) Object.prototype.hasOwnProperty.call(this.pointsList, e) && this.eport(e);
            }
        } ]), t;
    }(), Ys = function e(t, n) {
        a(this, e), this.userID = t;
        var r = {};
        if (r.userID = t, !ke(n)) for (var o = 0, i = n.length; o < i; o++) switch (n[o].tag) {
          case Qr.NICK:
            r.nick = n[o].value;
            break;

          case Qr.GENDER:
            r.gender = n[o].value;
            break;

          case Qr.BIRTHDAY:
            r.birthday = n[o].value;
            break;

          case Qr.LOCATION:
            r.location = n[o].value;
            break;

          case Qr.SELFSIGNATURE:
            r.selfSignature = n[o].value;
            break;

          case Qr.ALLOWTYPE:
            r.allowType = n[o].value;
            break;

          case Qr.LANGUAGE:
            r.language = n[o].value;
            break;

          case Qr.AVATAR:
            r.avatar = n[o].value;
            break;

          case Qr.MESSAGESETTINGS:
            r.messageSettings = n[o].value;
            break;

          case Qr.ADMINFORBIDTYPE:
            r.adminForbidType = n[o].value;
            break;

          case Qr.LEVEL:
            r.level = n[o].value;
            break;

          case Qr.ROLE:
            r.role = n[o].value;
            break;

          default:
            $.warn("snsProfileItem unkown tag->", n[o].tag);
        }
        this.profile = new Ks(r);
    }, Ws = function() {
        function t(e) {
            a(this, t), this.uc = e, this.TAG = "friend", this.Actions = {
                G: "get",
                D: "delete"
            }, this.friends = new Map(), this.pointer = new zs();
        }
        return i(t, [ {
            key: "isMyFriend",
            value: function(e) {
                var t = this.friends.has(e);
                return t || $.debug("FriendHandler.isMyFriend " + e + " is not my friend"), t;
            }
        }, {
            key: "_transformFriendList",
            value: function(e) {
                if (!ke(e) && !ke(e.infoItem)) {
                    $.info("FriendHandler._transformFriendList friendNum=" + e.friendNum);
                    for (var t, n, r = e.infoItem, o = 0, i = r.length; o < i; o++) n = r[o].infoAccount, 
                    t = new Ys(n, r[o].snsProfileItem), this.friends.set(n, t);
                }
            }
        }, {
            key: "_friends2map",
            value: function(e) {
                var t = new Map();
                for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.set(n, e[n]);
                return t;
            }
        }, {
            key: "getFriendList",
            value: function() {
                var n = this, e = this.uc.tim.connectionController, t = {};
                t.fromAccount = this.uc.getMyAccount(), $.info("FriendHandler.getFriendList myAccount=" + t.fromAccount);
                var r = this.uc.makeCapsule(this.TAG, this.Actions.G, t);
                return e.request(r).then(function(e) {
                    $.info("FriendHandler.getFriendList ok"), n._transformFriendList(e.data);
                    var t = m(n.friends.values());
                    return oo(t);
                }).catch(function(e) {
                    return $.error("FriendHandler.getFriendList error:", JSON.stringify(e)), io(e);
                });
            }
        }, {
            key: "deleteFriend",
            value: function(e) {
                if (!Array.isArray(e.toAccount)) return $.error("FriendHandler.deleteFriend options.toAccount 必需是数组"), 
                io({
                    code: yt,
                    message: Sn
                });
                1e3 < e.toAccount.length && ($.warn("FriendHandler.deleteFriend 删除好友人数不能超过1000人"), 
                e.toAccount.length = 1e3);
                var t = this.uc.tim.connectionController, n = this.uc.makeCapsule(this.TAG, this.Actions.D, e);
                return t.request(n).then(function(e) {
                    return $.info("FriendHandler.deleteFriend ok"), oo();
                }).catch(function(e) {
                    return $.error("FriendHandler.deleteFriend error:", e), io(e);
                });
            }
        } ]), t;
    }(), Xs = function e(t) {
        a(this, e);
    }, Js = function() {
        function t(e) {
            a(this, t), this.uc = e, this.TAG = "blacklist", this.Actions = {
                G: "get",
                C: "create",
                D: "delete"
            }, this.blacklistMap = new Map(), this.startIndex = 0, this.maxLimited = 100, this.curruentSequence = 0;
        }
        return i(t, [ {
            key: "getBlacklist",
            value: function() {
                var r = this, e = this.uc.tim.connectionController, t = {};
                t.fromAccount = this.uc.getMyAccount(), t.maxLimited = this.maxLimited, t.startIndex = 0, 
                t.lastSequence = this.curruentSequence;
                var o = new go();
                o.setMethod(Lo).setStart();
                var n = this.uc.makeCapsule(this.TAG, this.Actions.G, t);
                return e.request(n).then(function(e) {
                    var t = ke(e.data.blackListItem) ? 0 : e.data.blackListItem.length;
                    return o.setCode(0).setNetworkType(r.uc.getNetworkType()).setText(t).setEnd(), $.info("BlacklistHandler.getBlacklist ok"), 
                    r.curruentSequence = e.data.curruentSequence, r._handleResponse(e.data.blackListItem, 1), 
                    r._onBlacklistUpdated();
                }).catch(function(n) {
                    return r.uc.probeNetwork().then(function(e, t) {
                        o.setError(n, e, t).setEnd();
                    }), $.error("BlacklistHandler.getBlacklist error:", n), io(n);
                });
            }
        }, {
            key: "addBlacklist",
            value: function(e) {
                var t = this;
                if (!ee(e.userIDList)) return $.error("BlacklistHandler.addBlacklist options.userIDList 必需是数组"), 
                io({
                    code: It,
                    message: En
                });
                var n = this.uc.tim.loginInfo.identifier;
                if (1 === e.userIDList.length && e.userIDList[0] === n) return $.error("BlacklistHandler.addBlacklist 不能把自己拉黑"), 
                io({
                    code: Mt,
                    message: wn
                });
                e.userIDList.includes(n) && (e.userIDList = e.userIDList.filter(function(e) {
                    return e !== n;
                }), $.warn("BlacklistHandler.addBlacklist 不能把自己拉黑，已过滤"));
                var r = this.uc.tim.connectionController;
                e.fromAccount = this.uc.getMyAccount(), e.toAccount = e.userIDList;
                var o = this.uc.makeCapsule(this.TAG, this.Actions.C, e);
                return r.request(o).then(function(e) {
                    return $.info("BlacklistHandler.addBlacklist ok"), t._handleResponse(e.data.resultItem, 1), 
                    t._onBlacklistUpdated();
                }).catch(function(e) {
                    return $.error("BlacklistHandler.addBlacklist error:", e), io(e);
                });
            }
        }, {
            key: "_handleResponse",
            value: function(e, t) {
                if (!ke(e)) for (var n, r, o, i = 0, s = e.length; i < s; i++) r = e[i].to, o = e[i].resultCode, 
                (te(o) || 0 === o) && (t ? ((n = this.blacklistMap.has(r) ? this.blacklistMap.get(r) : new Xs()).userID = r, 
                !ke(e[i].addBlackTimeStamp) && (n.timeStamp = e[i].addBlackTimeStamp), this.blacklistMap.set(r, n)) : this.blacklistMap.has(r) && (n = this.blacklistMap.get(r), 
                this.blacklistMap.delete(r)));
                $.log("BlacklistHandler._handleResponse total=" + this.blacklistMap.size + " bAdd=" + t);
            }
        }, {
            key: "deleteBlacklist",
            value: function(e) {
                var t = this;
                if (!ee(e.userIDList)) return $.error("BlacklistHandler.deleteBlacklist options.userIDList 必需是数组"), 
                io({
                    code: Ct,
                    message: An
                });
                var n = this.uc.tim.connectionController;
                e.fromAccount = this.uc.getMyAccount(), e.toAccount = e.userIDList;
                var r = this.uc.makeCapsule(this.TAG, this.Actions.D, e);
                return n.request(r).then(function(e) {
                    return $.info("BlacklistHandler.deleteBlacklist ok"), t._handleResponse(e.data.resultItem, 0), 
                    t._onBlacklistUpdated();
                }).catch(function(e) {
                    return $.error("BlacklistHandler.deleteBlacklist error:", e), io(e);
                });
            }
        }, {
            key: "_onBlacklistUpdated",
            value: function() {
                var e = this.uc.tim.outerEmitter, t = m(this.blacklistMap.keys());
                return e.emit(l.BLACKLIST_UPDATED, t), oo(t);
            }
        }, {
            key: "handleBlackListDelAccount",
            value: function(e) {
                for (var t, n = [], r = 0, o = e.length; r < o; r++) t = e[r], this.blacklistMap.has(t) && (this.blacklistMap.delete(t), 
                n.push(t));
                0 < n.length && ($.log("BlacklistHandler.handleBlackListDelAccount delCount=" + n.length + " : " + n.join(",")), 
                this.tim.outerEmitter.emit(l.BLACKLIST_UPDATED, m(this.blacklistMap.keys())));
            }
        }, {
            key: "handleBlackListAddAccount",
            value: function(e) {
                for (var t, n = [], r = 0, o = e.length; r < o; r++) t = e[r], this.blacklistMap.has(t) || (this.blacklistMap.set(t, new Xs({
                    userID: t
                })), n.push(t));
                0 < n.length && ($.log("BlacklistHandler.handleBlackListAddAccount addCount=" + n.length + " : " + n.join(",")), 
                this.tim.outerEmitter.emit(l.BLACKLIST_UPDATED, m(this.blacklistMap.keys())));
            }
        }, {
            key: "reset",
            value: function() {
                this.blacklistMap.clear(), this.startIndex = 0, this.maxLimited = 100, this.curruentSequence = 0;
            }
        } ]), t;
    }(), Qs = function() {
        function t(e) {
            a(this, t), this.uc = e, this.TAG = "applyC2C", this.Actions = {
                C: "create",
                G: "get",
                D: "delete",
                U: "update"
            };
        }
        return i(t, [ {
            key: "applyAddFriend",
            value: function(e) {
                var t = this, n = this.uc.tim.connectionController, r = this.uc.makeCapsule(this.TAG, this.Actions.C, e), o = n.request(r);
                return o.then(function(e) {
                    t.uc.isActionSuccessful("applyAddFriend", t.Actions.C, e);
                }).catch(function(e) {}), o;
            }
        }, {
            key: "getPendency",
            value: function(e) {
                var t = this, n = this.tim.connectionController, r = this.uc.makeCapsule(this.TAG, this.Actions.G, e), o = n.request(r);
                return o.then(function(e) {
                    t.uc.isActionSuccessful("getPendency", t.Actions.G, e);
                }).catch(function(e) {}), o;
            }
        }, {
            key: "deletePendency",
            value: function(e) {
                var t = this, n = this.tim.connectionController, r = this.uc.makeCapsule(this.TAG, this.Actions.D, e), o = n.request(r);
                return o.then(function(e) {
                    t.uc.isActionSuccessful("deletePendency", t.Actions.D, e);
                }).catch(function(e) {}), o;
            }
        }, {
            key: "replyPendency",
            value: function() {
                var t = this, e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, n = this.tim.connectionController, r = this.uc.makeCapsule(this.TAG, this.Actions.U, e), o = n.request(r);
                return o.then(function(e) {
                    t.uc.isActionSuccessful("replyPendency", t.Actions.U, e);
                }).catch(function(e) {}), o;
            }
        } ]), t;
    }(), Zs = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).profileHandler = new $s(f(t)), 
            t.friendHandler = new Ws(f(t)), t.blacklistHandler = new Js(f(t)), t.applyC2CHandler = new Qs(f(t)), 
            t._initializeListener(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initializeListener",
            value: function(e) {
                var t = this.tim.innerEmitter;
                t.on(Yn, this.onContextUpdated, this), t.on(Ir, this.onProfileModified, this), t.on(_r, this.onNewFriendMessages, this), 
                t.on(Lr, this.onConversationsProfileUpdated, this);
            }
        }, {
            key: "onContextUpdated",
            value: function(e) {
                var t = e.data.context;
                0 != !!t.a2Key && 0 != !!t.tinyID && (this.profileHandler.getMyProfile(), this.friendHandler.getFriendList(), 
                this.blacklistHandler.getBlacklist());
            }
        }, {
            key: "onGotMyProfile",
            value: function() {
                this.triggerReady();
            }
        }, {
            key: "onProfileModified",
            value: function(e) {
                this.profileHandler.onProfileModified(e);
            }
        }, {
            key: "onNewFriendMessages",
            value: function(e) {
                $.debug("onNewFriendMessages", JSON.stringify(e.data)), ke(e.data.blackListDelAccount) || this.blacklistHandler.handleBlackListDelAccount(e.data.blackListDelAccount), 
                ke(e.data.blackListAddAccount) || this.blacklistHandler.handleBlackListAddAccount(e.data.blackListAddAccount);
            }
        }, {
            key: "onConversationsProfileUpdated",
            value: function(e) {
                this.profileHandler.onConversationsProfileUpdated(e.data);
            }
        }, {
            key: "getMyAccount",
            value: function() {
                return this.tim.context.identifier;
            }
        }, {
            key: "isMyFriend",
            value: function(e) {
                return this.friendHandler.isMyFriend(e);
            }
        }, {
            key: "makeCapsule",
            value: function(e, t, n) {
                return this.createPackage({
                    name: e,
                    action: t,
                    param: n
                });
            }
        }, {
            key: "getMyProfile",
            value: function() {
                return this.profileHandler.getMyProfile();
            }
        }, {
            key: "getUserProfile",
            value: function(e) {
                return this.profileHandler.getUserProfile(e);
            }
        }, {
            key: "updateMyProfile",
            value: function(e) {
                return this.profileHandler.updateMyProfile(e);
            }
        }, {
            key: "getFriendList",
            value: function() {
                return this.friendHandler.getFriendList();
            }
        }, {
            key: "deleteFriend",
            value: function(e) {
                return this.friendHandler.deleteFriend(e);
            }
        }, {
            key: "getBlacklist",
            value: function() {
                return this.blacklistHandler.getBlacklist();
            }
        }, {
            key: "addBlacklist",
            value: function(e) {
                return this.blacklistHandler.addBlacklist(e);
            }
        }, {
            key: "deleteBlacklist",
            value: function(e) {
                return this.blacklistHandler.deleteBlacklist(e);
            }
        }, {
            key: "applyAddFriend",
            value: function(e) {
                return this.applyC2CHandler.applyAddFriend(e);
            }
        }, {
            key: "getPendency",
            value: function(e) {
                return this.applyC2CHandler.getPendency(e);
            }
        }, {
            key: "deletePendency",
            value: function(e) {
                return this.applyC2CHandler.deletePendency(e);
            }
        }, {
            key: "replyPendency",
            value: function(e) {
                return this.applyC2CHandler.replyPendency(e);
            }
        }, {
            key: "reset",
            value: function() {
                $.warn("UserController.reset"), this.resetReady(), this.profileHandler.reset(), 
                this.blacklistHandler.reset(), this.checkTimes = 0;
            }
        } ]), n;
    }(), ea = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_TEXT, this.content = {
                text: e.text || ""
            };
        }
        return i(t, [ {
            key: "setText",
            value: function(e) {
                this.content.text = e;
            }
        }, {
            key: "sendable",
            value: function() {
                return 0 === this.content.text.length ? 0 : 1;
            }
        } ]), t;
    }(), ta = function() {
        function t(e) {
            a(this, t), this._imageMemoryURL = "", this._file = e.file, E ? this.createImageDataASURLInWXMiniApp(e.file) : this.createImageDataASURLInWeb(e.file), 
            this._initImageInfoModel(), this.type = B.MSG_IMAGE, this._percent = 0, this.content = {
                imageFormat: Jr.IMAGE_FORMAT[e.imageFormat] || Jr.IMAGE_FORMAT.UNKNOWN,
                uuid: e.uuid,
                imageInfoArray: []
            }, this.initImageInfoArray(e.imageInfoArray), this._defaultImage = "http://imgcache.qq.com/open/qcloud/video/act/webim-images/default.jpg", 
            this._autoFixUrl();
        }
        return i(t, [ {
            key: "_initImageInfoModel",
            value: function() {
                var t = this;
                this._ImageInfoModel = function(e) {
                    this.instanceID = fe(9999999), this.sizeType = e.type || 0, this.size = e.size || 0, 
                    this.width = e.width || 0, this.height = e.height || 0, this.imageUrl = e.url || "", 
                    this.url = e.url || t._imageMemoryURL || t._defaultImage;
                }, this._ImageInfoModel.prototype = {
                    setSizeType: function(e) {
                        this.sizeType = e;
                    },
                    setImageUrl: function(e) {
                        e && (this.imageUrl = e);
                    },
                    getImageUrl: function() {
                        return this.imageUrl;
                    }
                };
            }
        }, {
            key: "initImageInfoArray",
            value: function(e) {
                for (var t = 2, n = null, r = null; 0 <= t; ) r = void 0 === e || void 0 === e[t] ? {
                    type: 0,
                    size: 0,
                    width: 0,
                    height: 0,
                    url: ""
                } : e[t], (n = new this._ImageInfoModel(r)).setSizeType(t + 1), this.addImageInfo(n), 
                t--;
            }
        }, {
            key: "updateImageInfoArray",
            value: function(e) {
                for (var t, n = this.content.imageInfoArray.length, r = 0; r < n; r++) t = this.content.imageInfoArray[r], 
                e.size && (t.size = e.size), e.url && t.setImageUrl(e.url), e.width && (t.width = e.width), 
                e.height && (t.height = e.height);
            }
        }, {
            key: "_autoFixUrl",
            value: function() {
                for (var e = this.content.imageInfoArray.length, t = "", n = "", r = [ "http", "https" ], o = null, i = 0; i < e; i++) this.content.imageInfoArray[i].url && "" !== (o = this.content.imageInfoArray[i]).imageUrl && (n = o.imageUrl.slice(0, o.imageUrl.indexOf("://") + 1), 
                t = o.imageUrl.slice(o.imageUrl.indexOf("://") + 1), r.indexOf(n) < 0 && (n = "https:"), 
                this.content.imageInfoArray[i].setImageUrl([ n, t ].join("")));
            }
        }, {
            key: "updatePercent",
            value: function(e) {
                this._percent = e, 1 < this._percent && (this._percent = 1);
            }
        }, {
            key: "updateImageFormat",
            value: function(e) {
                this.content.imageFormat = e;
            }
        }, {
            key: "createImageDataASURLInWeb",
            value: function(e) {
                void 0 !== e && 0 < e.files.length && (this._imageMemoryURL = window.URL.createObjectURL(e.files[0]));
            }
        }, {
            key: "createImageDataASURLInWXMiniApp",
            value: function(e) {
                e && e.url && (this._imageMemoryURL = e.url);
            }
        }, {
            key: "replaceImageInfo",
            value: function(e, t) {
                this.content.imageInfoArray[t] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t] = e);
            }
        }, {
            key: "addImageInfo",
            value: function(e) {
                3 <= this.content.imageInfoArray.length || this.content.imageInfoArray.push(e);
            }
        }, {
            key: "sendable",
            value: function() {
                return 0 === this.content.imageInfoArray.length ? 0 : "" === this.content.imageInfoArray[0].imageUrl ? 0 : 0 === this.content.imageInfoArray[0].size ? 0 : 1;
            }
        } ]), t;
    }(), na = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_FACE, this.content = e || null;
        }
        return i(t, [ {
            key: "sendable",
            value: function() {
                return null === this.content ? 0 : 1;
            }
        } ]), t;
    }(), ra = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_AUDIO, this._percent = 0, this.content = {
                downloadFlag: 2,
                second: e.second,
                size: e.size,
                url: e.url,
                remoteAudioUrl: "",
                uuid: e.uuid
            };
        }
        return i(t, [ {
            key: "updatePercent",
            value: function(e) {
                this._percent = e, 1 < this._percent && (this._percent = 1);
            }
        }, {
            key: "updateAudioUrl",
            value: function(e) {
                this.content.remoteAudioUrl = e;
            }
        }, {
            key: "sendable",
            value: function() {
                return "" === this.content.remoteAudioUrl ? 0 : 1;
            }
        } ]), t;
    }(), oa = {
        from: 1,
        groupID: 1,
        groupName: 1,
        to: 1
    }, ia = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_GRP_TIP, this.content = {}, this._initContent(e);
        }
        return i(t, [ {
            key: "_initContent",
            value: function(t) {
                var n = this;
                Object.keys(t).forEach(function(e) {
                    switch (e) {
                      case "remarkInfo":
                        break;

                      case "groupProfile":
                        n.content.groupProfile = {}, n._initGroupProfile(t[e]);
                        break;

                      case "operatorInfo":
                      case "memberInfoList":
                        break;

                      default:
                        n.content[e] = t[e];
                    }
                }), this.content.userIDList || (this.content.userIDList = [ this.content.operatorID ]);
            }
        }, {
            key: "_initGroupProfile",
            value: function(e) {
                for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                    var r = t[n];
                    oa[r] && (this.content.groupProfile[r] = e[r]);
                }
            }
        } ]), t;
    }(), sa = {
        from: 1,
        groupID: 1,
        name: 1,
        to: 1
    }, aa = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_GRP_SYS_NOTICE, this.content = {}, this._initContent(e);
        }
        return i(t, [ {
            key: "_initContent",
            value: function(t) {
                var n = this;
                Object.keys(t).forEach(function(e) {
                    switch (e) {
                      case "memberInfoList":
                        break;

                      case "remarkInfo":
                        n.content.handleMessage = t[e];
                        break;

                      case "groupProfile":
                        n.content.groupProfile = {}, n._initGroupProfile(t[e]);
                        break;

                      default:
                        n.content[e] = t[e];
                    }
                });
            }
        }, {
            key: "_initGroupProfile",
            value: function(e) {
                for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                    var r = t[n];
                    sa[r] && (this.content.groupProfile[r] = e[r]);
                }
            }
        } ]), t;
    }(), ua = function() {
        function r(e) {
            a(this, r);
            var t = this._check(e);
            if (t instanceof qn) throw t;
            this.type = B.MSG_FILE, this._percent = 0;
            var n = this._getFileInfo(e);
            this.content = {
                downloadFlag: 2,
                fileUrl: e.url || "",
                uuid: e.uuid,
                fileName: n.name || "",
                fileSize: n.size || 0
            };
        }
        return i(r, [ {
            key: "_getFileInfo",
            value: function(e) {
                if (e.fileName && e.fileSize) return {
                    size: e.fileSize,
                    name: e.fileName
                };
                if (E) return {};
                var t = e.file.files[0];
                return {
                    size: t.size,
                    name: t.name,
                    type: t.type.slice(t.type.lastIndexOf("/") + 1).toLowerCase()
                };
            }
        }, {
            key: "updatePercent",
            value: function(e) {
                this._percent = e, 1 < this._percent && (this._percent = 1);
            }
        }, {
            key: "updateFileUrl",
            value: function(e) {
                this.content.fileUrl = e;
            }
        }, {
            key: "_check",
            value: function(e) {
                if (20971520 < e.size) return new qn({
                    code: et,
                    message: "".concat(an, ": ").concat(20971520, " bytes")
                });
            }
        }, {
            key: "sendable",
            value: function() {
                return "" === this.content.fileUrl ? 0 : "" === this.content.fileName ? 0 : 0 === this.content.fileSize ? 0 : 1;
            }
        } ]), r;
    }(), ca = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_CUSTOM, this.content = {
                data: e.data || "",
                description: e.description || "",
                extension: e.extension || ""
            };
        }
        return i(t, [ {
            key: "setData",
            value: function(e) {
                return this.content.data = e, this;
            }
        }, {
            key: "setDescription",
            value: function(e) {
                return this.content.description = e, this;
            }
        }, {
            key: "setExtension",
            value: function(e) {
                return this.content.extension = e, this;
            }
        }, {
            key: "sendable",
            value: function() {
                return 0 === this.content.data.length && 0 === this.content.description.length && 0 === this.content.extension.length ? 0 : 1;
            }
        } ]), t;
    }(), la = function() {
        function t(e) {
            a(this, t), this.type = B.MSG_VIDEO, this._percent = 0, this.content = {
                remoteVideoUrl: e.remoteVideoUrl,
                videoFormat: e.videoFormat,
                videoSecond: parseInt(e.videoSecond, 10),
                videoSize: e.videoSize,
                videoUrl: e.videoUrl,
                videoDownloadFlag: 2,
                videoUUID: e.videoUUID,
                thumbUUID: e.thumbUUID,
                thumbFormat: e.thumbFormat,
                thumbWidth: e.thumbWidth,
                thumbHeight: e.thumbHeight,
                thumbSize: e.thumbSize,
                thumbDownloadFlag: 2,
                thumbUrl: e.thumbUrl
            };
        }
        return i(t, [ {
            key: "updatePercent",
            value: function(e) {
                this._percent = e, 1 < this._percent && (this._percent = 1);
            }
        }, {
            key: "updateVideoUrl",
            value: function(e) {
                e && (this.content.remoteVideoUrl = e);
            }
        }, {
            key: "sendable",
            value: function() {
                return "" === this.content.remoteVideoUrl ? 0 : 1;
            }
        } ]), t;
    }(), pa = function e(t) {
        a(this, e), this.type = B.MSG_GEO, this.content = t;
    }, ha = function() {
        function t(e) {
            a(this, t), this.ID = "", this.conversationID = e.conversationID || null, this.conversationType = e.conversationType || B.CONV_C2C, 
            this.conversationSubType = e.conversationSubType, this.time = e.time || Math.ceil(Date.now() / 1e3), 
            this.sequence = e.sequence || 0, this.clientSequence = e.clientSequence || e.sequence || 0, 
            this.random = e.random || fe(), this.messagePriority = e.messagePriority || 0, this._elements = [], 
            this.isPlaceMessage = 0, this.geo = {}, this.from = e.from || null, this.to = e.to || null, 
            this.flow = "", this.isSystemMessage = e.isSystemMessage || 0, this.protocol = e.protocol || "JSON", 
            this.isResend = 0, this.isRead = 0, this.status = e.status || jr.SUCCESS, this.reInitialize(e.currentUser), 
            this.extractGroupInfo(e.groupProfile || null);
        }
        return i(t, [ {
            key: "getElements",
            value: function() {
                return this._elements;
            }
        }, {
            key: "extractGroupInfo",
            value: function(e) {
                if (null !== e) {
                    var t = e.messageFromAccountExtraInformation;
                    this.nick = "", "string" == typeof e.fromAccountNick && (this.nick = e.fromAccountNick), 
                    this.avatar = "", "string" == typeof e.fromAccountHeadurl && (this.avatar = e.fromAccountHeadurl), 
                    this.nameCard = "", "object" === s(t) && t.hasOwnProperty("nameCard") && (this.nameCard = t.nameCard);
                }
            }
        }, {
            key: "_initProxy",
            value: function() {
                this.payload = this._elements[0].content, this.type = this._elements[0].type;
            }
        }, {
            key: "reInitialize",
            value: function(e) {
                e && (this.status = this.from ? jr.SUCCESS : jr.UNSEND, !this.from && (this.from = e), 
                this.isRead = 1), this._initFlow(e), this._initielizeSequence(e), this._concactConversationID(e), 
                this.generateMessageID(e);
            }
        }, {
            key: "isSendable",
            value: function() {
                return 0 === this._elements.length ? 0 : "function" != typeof this._elements[0].sendable ? ($.warn("".concat(this._elements[0].type, ' need "boolean : sendable()" method')), 
                0) : this._elements[0].sendable();
            }
        }, {
            key: "_initTo",
            value: function(e) {
                this.conversationType === B.CONV_GROUP && (this.to = e.groupID);
            }
        }, {
            key: "_initielizeSequence",
            value: function(e) {
                0 === this.clientSequence && e && (this.clientSequence = function(e) {
                    if (!e) return $.error("autoincrementIndex(string: key) need key parameter"), 0;
                    if (void 0 === ye[e]) {
                        var t = new Date(), n = "3".concat(t.getHours()).slice(-2), r = "0".concat(t.getMinutes()).slice(-2), o = "0".concat(t.getSeconds()).slice(-2);
                        ye[e] = parseInt([ n, r, o, "0001" ].join("")), o = r = n = null, $.warn("utils.autoincrementIndex() create new sequence : ".concat(e, " = ").concat(ye[e]));
                    }
                    return ye[e]++;
                }(e)), 0 === this.sequence && this.conversationType === B.CONV_C2C && (this.sequence = this.clientSequence);
            }
        }, {
            key: "generateMessageID",
            value: function(e) {
                var t = e === this.from ? 1 : 0, n = 0 < this.sequence ? this.sequence : this.clientSequence;
                this.ID = "".concat(this.conversationID, "-").concat(n, "-").concat(this.random, "-").concat(t);
            }
        }, {
            key: "_initFlow",
            value: function(e) {
                "" !== e && (this.flow = e === this.from ? "out" : "in");
            }
        }, {
            key: "_concactConversationID",
            value: function(e) {
                var t = this.to, n = "", r = this.conversationType;
                r !== B.CONV_SYSTEM ? (n = r === B.CONV_C2C ? e === this.from ? t : this.from : this.to, 
                this.conversationID = "".concat(r).concat(n)) : this.conversationID = B.CONV_SYSTEM;
            }
        }, {
            key: "isElement",
            value: function(e) {
                return e instanceof ea || e instanceof ta || e instanceof na || e instanceof ra || e instanceof ua || e instanceof la || e instanceof ia || e instanceof aa || e instanceof ca || e instanceof pa;
            }
        }, {
            key: "setElement",
            value: function(e) {
                var t = this;
                if (this.isElement(e)) return this._elements = [ e ], void this._initProxy();
                var n = function(e) {
                    switch (e.type) {
                      case B.MSG_TEXT:
                        t.setTextElement(e.content);
                        break;

                      case B.MSG_IMAGE:
                        t.setImageElement(e.content);
                        break;

                      case B.MSG_AUDIO:
                        t.setAudioElement(e.content);
                        break;

                      case B.MSG_FILE:
                        t.setFileElement(e.content);
                        break;

                      case B.MSG_VIDEO:
                        t.setVideoElement(e.content);
                        break;

                      case B.MSG_CUSTOM:
                        t.setCustomElement(e.content);
                        break;

                      case B.MSG_GEO:
                        t.setGEOElement(e.content);
                        break;

                      case B.MSG_GRP_TIP:
                        t.setGroupTipElement(e.content);
                        break;

                      case B.MSG_GRP_SYS_NOTICE:
                        t.setGroupSystemNoticeElement(e.content);
                        break;

                      case B.MSG_FACE:
                        t.setFaceElement(e.content);
                        break;

                      default:
                        $.warn(e.type, e.content, "no operation......");
                    }
                };
                if (Array.isArray(e)) for (var r = 0; r < e.length; r++) n(e[r]); else n(e);
                this._initProxy();
            }
        }, {
            key: "setTextElement",
            value: function(e) {
                var t = "string" == typeof e ? e : e.text, n = new ea({
                    text: t
                });
                this._elements.push(n);
            }
        }, {
            key: "setImageElement",
            value: function(e) {
                var t = new ta(e);
                this._elements.push(t);
            }
        }, {
            key: "setAudioElement",
            value: function(e) {
                var t = new ra(e);
                this._elements.push(t);
            }
        }, {
            key: "setFileElement",
            value: function(e) {
                var t = new ua(e);
                this._elements.push(t);
            }
        }, {
            key: "setVideoElement",
            value: function(e) {
                var t = new la(e);
                this._elements.push(t);
            }
        }, {
            key: "setGEOElement",
            value: function(e) {
                var t = new pa(e);
                this._elements.push(t);
            }
        }, {
            key: "setCustomElement",
            value: function(e) {
                var t = new ca(e);
                this._elements.push(t);
            }
        }, {
            key: "setGroupTipElement",
            value: function(e) {
                var t = new ia(e);
                this._elements.push(t);
            }
        }, {
            key: "setGroupSystemNoticeElement",
            value: function(e) {
                var t = new aa(e);
                this._elements.push(t);
            }
        }, {
            key: "setFaceElement",
            value: function(e) {
                var t = new na(e);
                this._elements.push(t);
            }
        }, {
            key: "elements",
            get: function() {
                return $.warn("！！！Message 实例的 elements 属性即将废弃，请尽快修改。使用 type 和 payload 属性处理单条消息，兼容组合消息使用 _elements 属性！！！"), 
                this._elements;
            }
        } ]), t;
    }(), fa = [ "groupID", "name", "avatar", "type", "introduction", "notification", "ownerID", "selfInfo", "createTime", "infoSequence", "lastInfoTime", "lastMessage", "nextMessageSeq", "memberNum", "maxMemberNum", "memberList", "joinOption", "groupCustomField" ], ga = function() {
        function t(e) {
            a(this, t), this.groupID = "", this.name = "", this.avatar = "", this.type = "", 
            this.introduction = "", this.notification = "", this.ownerID = "", this.createTime = "", 
            this.infoSequence = "", this.lastInfoTime = "", this.selfInfo = {
                messageRemindType: "",
                joinTime: "",
                nameCard: "",
                role: ""
            }, this.lastMessage = {
                lastTime: "",
                lastSequence: "",
                fromAccount: "",
                messageForShow: ""
            }, this.nextMessageSeq = "", this.memberNum = "", this.maxMemberNum = "", this.joinOption = "", 
            this.groupCustomField = [], this._initGroup(e);
        }
        return i(t, [ {
            key: "_initGroup",
            value: function(e) {
                for (var t in e) fa.indexOf(t) < 0 || ("selfInfo" !== t ? this[t] = e[t] : this.updateSelfInfo(e[t]));
            }
        }, {
            key: "updateGroup",
            value: function(e) {
                e.lastMsgTime && (this.lastMessage.lastTime = e.lastMsgTime), ce(this, e, [ "members", "errorCode", "lastMsgTime" ]);
            }
        }, {
            key: "updateSelfInfo",
            value: function(e) {
                var t = e.nameCard, n = e.joinTime, r = e.role, o = e.messageRemindType;
                ce(this.selfInfo, {
                    nameCard: t,
                    joinTime: n,
                    role: r,
                    messageRemindType: o
                }, [], [ "", null, void 0, 0, NaN ]);
            }
        } ]), t;
    }(), da = function(e, t) {
        if (te(t)) return "";
        switch (e) {
          case B.MSG_TEXT:
            return t.text;

          case B.MSG_IMAGE:
            return "[图片]";

          case B.MSG_GEO:
            return "[位置]";

          case B.MSG_AUDIO:
            return "[语音]";

          case B.MSG_VIDEO:
            return "[视频]";

          case B.MSG_FILE:
            return "[文件]";

          case B.MSG_CUSTOM:
            return "[自定义消息]";

          case B.MSG_GRP_TIP:
            return "[群提示消息]";

          case B.MSG_GRP_SYS_NOTICE:
            return "[群系统通知]";

          case B.MSG_FACE:
            return "[动画表情]";

          default:
            return "";
        }
    }, ma = function() {
        function n(e) {
            var t;
            a(this, n), this.conversationID = e.conversationID || "", this.unreadCount = e.unreadCount || 0, 
            this.type = e.type || "", this.lastMessage = (t = e.lastMessage, te(t) ? {
                lastTime: 0,
                lastSequence: 0,
                fromAccount: 0,
                messageForShow: "",
                payload: null,
                type: ""
            } : t instanceof ha ? {
                lastTime: t.time || 0,
                lastSequence: t.sequence || 0,
                fromAccount: t.from || "",
                messageForShow: da(t.type, t.payload),
                payload: t.payload || null,
                type: t.type || null
            } : H({}, t, {
                messageForShow: da(t.type, t.payload)
            })), this._isInfoCompleted = 0, this._initProfile(e);
        }
        return i(n, [ {
            key: "_initProfile",
            value: function(t) {
                var n = this;
                Object.keys(t).forEach(function(e) {
                    switch (e) {
                      case "userProfile":
                        n.userProfile = t.userProfile;
                        break;

                      case "groupProfile":
                        n.groupProfile = t.groupProfile;
                    }
                }), te(this.userProfile) && this.type === B.CONV_C2C ? this.userProfile = new Ks({
                    userID: t.conversationID.replace("C2C", "")
                }) : te(this.groupProfile) && this.type === B.CONV_GROUP && (this.groupProfile = new ga({
                    groupID: t.conversationID.replace("GROUP", "")
                }));
            }
        }, {
            key: "updateUnreadCount",
            value: function(e, t) {
                te(e) || (this.subType === B.GRP_CHATROOM || Ce(this.subType) ? this.unreadCount = 0 : t && this.type === B.CONV_GROUP ? this.unreadCount = e : this.unreadCount = this.unreadCount + e);
            }
        }, {
            key: "toAccount",
            get: function() {
                return this.conversationID.replace("C2C", "").replace("GROUP", "");
            }
        }, {
            key: "subType",
            get: function() {
                return this.groupProfile ? this.groupProfile.type : "";
            }
        } ]), n;
    }(), ya = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).pagingStatus = zr.NOT_START, 
            t.pagingTimeStamp = 0, t.conversationMap = new Map(), t.tempGroupList = [], t._initListeners(), 
            t;
        }
        return u(n, Yr), i(n, [ {
            key: "hasLocalConversationMap",
            value: function() {
                return 0 < this.conversationMap.size;
            }
        }, {
            key: "createLocalConversation",
            value: function(e) {
                return this.conversationMap.has(e) ? this.conversationMap.get(e) : new ma({
                    conversationID: e,
                    type: e.slice(0, 3) === B.CONV_C2C ? B.CONV_C2C : B.CONV_GROUP
                });
            }
        }, {
            key: "hasLocalConversation",
            value: function(e) {
                return this.conversationMap.has(e);
            }
        }, {
            key: "getConversationList",
            value: function() {
                var o = this;
                $.log("ConversationController.getConversationList."), this.pagingStatus === zr.REJECTED && ($.log("ConversationController.getConversationList. continue to sync conversationList"), 
                this._syncConversationList());
                var i = new go();
                i.setMethod(Mo).setStart();
                var e = this.createPackage({
                    name: "conversation",
                    action: "query"
                });
                return this.tim.connectionController.request(e).then(function(e) {
                    var t = e.data.conversations, n = void 0 === t ? [] : t, r = o._getConversationOptions(n);
                    return o._updateLocalConversationList(r, 1), o._setStorageConversationList(), i.setCode(0).setText(n.length).setEnd(), 
                    $.log("ConversationController.getConversationList ok."), oo({
                        conversationList: o.getLocalConversationList()
                    });
                }).catch(function(n) {
                    return o.probeNetwork().then(function(e, t) {
                        i.setError(n, e, t).setEnd();
                    }), $.error("ConversationController.getConversationList error:", n), io(n);
                });
            }
        }, {
            key: "_syncConversationList",
            value: function() {
                var t = this, r = new go();
                return r.setMethod(So).setStart(), this.pagingStatus === zr.NOT_START && this.conversationMap.clear(), 
                this._autoPagingSyncConversationList().then(function(e) {
                    return t.pagingStatus = zr.RESOLVED, t._setStorageConversationList(), r.setCode(0).setText("".concat(t.conversationMap.size)).setEnd(), 
                    e;
                }).catch(function(n) {
                    return t.pagingStatus = zr.REJECTED, r.setText(t.pagingTimeStamp), t.probeNetwork().then(function(e, t) {
                        r.setError(n, e, t).setEnd();
                    }), io(n);
                });
            }
        }, {
            key: "_autoPagingSyncConversationList",
            value: function() {
                var a = this;
                this.pagingStatus = zr.PENDING;
                var e = this.createPackage({
                    name: "conversation",
                    action: "pagingQuery",
                    param: {
                        fromAccount: this.tim.context.identifier,
                        timeStamp: this.pagingTimeStamp,
                        orderType: 1
                    }
                });
                return this.connectionController.request(e).then(function(e) {
                    var t = e.data, n = t.completeFlag, r = t.conversations, o = void 0 === r ? [] : r, i = t.timeStamp;
                    if (0 < o.length) {
                        var s = a._getConversationOptions(o);
                        a._updateLocalConversationList(s, 1);
                    }
                    return a._isReady ? a._emitConversationUpdate() : a.triggerReady(), a.pagingTimeStamp = i, 
                    1 !== n ? a._autoPagingSyncConversationList() : oo();
                });
            }
        }, {
            key: "getConversationProfile",
            value: function(t) {
                var e = this.conversationMap.has(t) ? this.conversationMap.get(t) : this.createLocalConversation(t);
                return e._isInfoCompleted || e.type === B.CONV_SYSTEM ? oo({
                    conversation: e
                }) : ($.log("ConversationController.getConversationProfile. conversationID:", t), 
                this._updateUserOrGroupProfileCompletely(e).then(function(e) {
                    return $.log("ConversationController.getConversationProfile ok. conversationID:", t), 
                    e;
                }).catch(function(e) {
                    return $.error("ConversationController.getConversationProfile error:", e), io(e);
                }));
            }
        }, {
            key: "deleteConversation",
            value: function(e) {
                var t = this, n = {};
                if (!this.conversationMap.has(e)) {
                    var r = new qn({
                        code: nt,
                        message: cn
                    });
                    return io(r);
                }
                switch (this.conversationMap.get(e).type) {
                  case B.CONV_C2C:
                    n.type = 1, n.toAccount = e.slice(3);
                    break;

                  case B.CONV_GROUP:
                    n.type = 2, n.toGroupID = e.slice(5);
                    break;

                  case B.CONV_SYSTEM:
                    return this.tim.groupController.deleteGroupSystemNotice({
                        messageList: this.tim.messageController.getLocalMessageList(e)
                    }), this.deleteLocalConversation(e), oo({
                        conversationID: e
                    });

                  default:
                    var o = new qn({
                        code: ot,
                        message: pn
                    });
                    return io(o);
                }
                $.log("ConversationController.deleteConversation. conversationID:", e);
                var i = this.createPackage({
                    name: "conversation",
                    action: "delete",
                    param: n
                });
                return this.tim.setMessageRead({
                    conversationID: e
                }).then(function() {
                    return t.connectionController.request(i);
                }).then(function() {
                    return $.log("ConversationController.deleteConversation ok. conversationID:", e), 
                    t.deleteLocalConversation(e), oo({
                        conversationID: e
                    });
                }).catch(function(e) {
                    return $.error("ConversationController.deleteConversation error:", e), io(e);
                });
            }
        }, {
            key: "getLocalConversationList",
            value: function() {
                return m(this.conversationMap.values());
            }
        }, {
            key: "getLocalConversation",
            value: function(e) {
                return this.conversationMap.get(e);
            }
        }, {
            key: "_initLocalConversationList",
            value: function() {
                var e = new go();
                e.setMethod(Do).setStart(), $.time(po), $.log("ConversationController._initLocalConversationList init");
                var t = this._getStorageConversationList();
                if (t) {
                    for (var n = t.length, r = 0; r < n; r++) this.conversationMap.set(t[r].conversationID, new ma(t[r]));
                    this._emitConversationUpdate(1, 0), e.setCode(0).setNetworkType(this.getNetworkType()).setText(n).setEnd();
                } else e.setCode(0).setNetworkType(this.getNetworkType()).setText(0).setEnd();
                this._syncConversationList();
            }
        }, {
            key: "_getStorageConversationList",
            value: function() {
                return this.tim.storage.getItem("conversationMap");
            }
        }, {
            key: "_setStorageConversationList",
            value: function() {
                var e = this.getLocalConversationList().slice(0, 20).map(function(e) {
                    return {
                        conversationID: e.conversationID,
                        type: e.type,
                        subType: e.subType,
                        lastMessage: e.lastMessage,
                        groupProfile: e.groupProfile,
                        userProfile: e.userProfile
                    };
                });
                this.tim.storage.setItem("conversationMap", e);
            }
        }, {
            key: "_initListeners",
            value: function() {
                var e = this;
                this.tim.innerEmitter.once(Yn, this._initLocalConversationList, this), this.tim.innerEmitter.on(Jn, this._onSendOrReceiveMessage, this), 
                this.tim.innerEmitter.on(Zn, this._handleSyncMessages, this), this.tim.innerEmitter.on(er, this._handleSyncMessages, this), 
                this.tim.innerEmitter.on(tr, this._onSendOrReceiveMessage, this), this.tim.innerEmitter.on(rr, this._onSendOrReceiveMessage, this), 
                this.tim.innerEmitter.on(or, this._onSendOrReceiveMessage, this), this.tim.innerEmitter.on(Dr, this._updateConversationGroupProfile, this), 
                this.tim.innerEmitter.on(Pr, this._updateConversationUserProfile, this), this.ready(function() {
                    0 < e.tempGroupList.length && (e._updateConversationGroupProfile(e.tempGroupList), 
                    e.tempGroupList.length = 0);
                });
            }
        }, {
            key: "_updateConversationGroupProfile",
            value: function(e) {
                var r = this;
                ee(e) && 0 === e.length || (this.hasLocalConversationMap() ? (e.forEach(function(e) {
                    var t = "GROUP".concat(e.groupID);
                    if (r.conversationMap.has(t)) {
                        var n = r.conversationMap.get(t);
                        n.groupProfile = e, n.lastMessage.lastSequence = e.nextMessageSeq - 1, n.subType || (n.subType = e.type);
                    }
                }), this._emitConversationUpdate(1, 0)) : this.tempGroupList = e);
            }
        }, {
            key: "_updateConversationUserProfile",
            value: function(e) {
                var n = this;
                e.data.forEach(function(e) {
                    var t = "C2C".concat(e.userID);
                    n.conversationMap.has(t) && (n.conversationMap.get(t).userProfile = e);
                }), this._emitConversationUpdate(1, 0);
            }
        }, {
            key: "_handleSyncMessages",
            value: function(e) {
                this._onSendOrReceiveMessage(e, 1);
            }
        }, {
            key: "_onSendOrReceiveMessage",
            value: function(e) {
                var t = this, n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, r = e.data.eventDataList;
                this._isReady ? 0 !== r.length && (this._updateLocalConversationList(r, 0, n), this._setStorageConversationList(), 
                this._emitConversationUpdate()) : this.ready(function() {
                    t._onSendOrReceiveMessage(e, n);
                });
            }
        }, {
            key: "_updateLocalConversationList",
            value: function(e, t, n) {
                var r;
                r = this._updateTempConversations(e, t, n), this.conversationMap = new Map(this._sortConversations([].concat(m(r.conversations), m(this.conversationMap)))), 
                t || this._updateUserOrGroupProfile(r.newerConversations);
            }
        }, {
            key: "_updateTempConversations",
            value: function(e, t, n) {
                for (var r = [], o = [], i = 0, s = e.length; i < s; i++) {
                    var a = new ma(e[i]), u = this.conversationMap.get(a.conversationID);
                    if (this.conversationMap.has(a.conversationID)) {
                        var c = [ "unreadCount", "allowType", "adminForbidType", "payload" ];
                        n && c.push("lastMessage"), ce(u, a, c, [ null, void 0, "", 0, NaN ]), u.updateUnreadCount(a.unreadCount, t), 
                        n || (u.lastMessage.payload = e[i].lastMessage.payload), this.conversationMap.delete(u.conversationID), 
                        r.push([ u.conversationID, u ]);
                    } else {
                        if (a.type === B.CONV_GROUP) {
                            var l = a.groupProfile.groupID, p = this.tim.groupController.getLocalGroupProfile(l);
                            p && (a.groupProfile = p, a.updateUnreadCount(0));
                        }
                        o.push(a), r.push([ a.conversationID, a ]);
                    }
                }
                return {
                    conversations: r,
                    newerConversations: o
                };
            }
        }, {
            key: "_sortConversations",
            value: function(e) {
                return e.sort(function(e, t) {
                    return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime;
                });
            }
        }, {
            key: "_updateUserOrGroupProfile",
            value: function(e) {
                var r = this;
                if (0 !== e.length) {
                    var n = [], o = [];
                    e.forEach(function(e) {
                        if (e.type === B.CONV_C2C) n.push(e.toAccount); else if (e.type === B.CONV_GROUP) {
                            var t = e.toAccount;
                            r.tim.groupController.hasLocalGroup(t) ? e.groupProfile = r.tim.groupController.getLocalGroupProfile(t) : o.push(t);
                        }
                    }), 0 < n.length && this.tim.getUserProfile({
                        userIDList: n
                    }).then(function(e) {
                        var t = e.data;
                        ee(t) ? t.forEach(function(e) {
                            r.conversationMap.get("C2C".concat(e.userID)).userProfile = e;
                        }) : r.conversationMap.get("C2C".concat(t.userID)).userProfile = t;
                    }), 0 < o.length && this.tim.groupController.getGroupProfileAdvance({
                        groupIDList: o,
                        responseFilter: {
                            groupBaseInfoFilter: [ "Type", "Name", "FaceUrl" ]
                        }
                    }).then(function(e) {
                        e.data.successGroupList.forEach(function(e) {
                            var t = "GROUP".concat(e.groupID);
                            if (r.conversationMap.has(t)) {
                                var n = r.conversationMap.get(t);
                                ce(n.groupProfile, e, [], [ null, void 0, "", 0, NaN ]), !n.subType && e.type && (n.subType = e.type);
                            }
                        });
                    });
                }
            }
        }, {
            key: "_updateUserOrGroupProfileCompletely",
            value: function(n) {
                var r = this;
                return n.type === B.CONV_C2C ? this.tim.getUserProfile({
                    userIDList: [ n.toAccount ]
                }).then(function(e) {
                    var t = e.data;
                    return 0 === t.length ? io(new qn({
                        code: rt,
                        message: ln
                    })) : (n.userProfile = t[0], n._isInfoCompleted = 1, r._unshiftConversation(n), 
                    oo({
                        conversation: n
                    }));
                }) : this.tim.getGroupProfile({
                    groupID: n.toAccount
                }).then(function(e) {
                    return n.groupProfile = e.data.group, n._isInfoCompleted = 1, r._unshiftConversation(n), 
                    oo({
                        conversation: n
                    });
                });
            }
        }, {
            key: "_unshiftConversation",
            value: function(e) {
                e instanceof ma && !this.conversationMap.has(e.conversationID) && (this.conversationMap = new Map([ [ e.conversationID, e ] ].concat(m(this.conversationMap))), 
                this._setStorageConversationList(), this._emitConversationUpdate(1, 0));
            }
        }, {
            key: "deleteLocalConversation",
            value: function(e) {
                return this.conversationMap.delete(e), this._setStorageConversationList(), this.tim.innerEmitter.emit(Rr, e), 
                this._emitConversationUpdate(1, 0), this.conversationMap.has(e);
            }
        }, {
            key: "_getConversationOptions",
            value: function(e) {
                var n = [], t = e.filter(function(e) {
                    var t = e.lastMsg;
                    return Z(t);
                }).map(function(e) {
                    if (1 === e.type) {
                        var t = {
                            userID: e.userID,
                            nick: e.c2CNick,
                            avatar: e.c2CImage
                        };
                        return n.push(t), {
                            conversationID: "C2C".concat(e.userID),
                            type: "C2C",
                            lastMessage: {
                                lastTime: e.time,
                                lastSequence: e.sequence,
                                fromAccount: e.lastC2CMsgFromAccount,
                                messageForShow: e.messageShow,
                                type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                                payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                            },
                            userProfile: new Ks(t)
                        };
                    }
                    return {
                        conversationID: "GROUP".concat(e.groupID),
                        type: "GROUP",
                        lastMessage: {
                            lastTime: e.time,
                            lastSequence: e.messageReadSeq + e.unreadCount,
                            fromAccount: e.msgGroupFromAccount,
                            messageForShow: e.messageShow,
                            type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                            payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                        },
                        groupProfile: new ga({
                            groupID: e.groupID,
                            name: e.groupNick,
                            avatar: e.groupImage
                        }),
                        unreadCount: e.unreadCount
                    };
                });
                return 0 < n.length && this.tim.innerEmitter.emit(Lr, {
                    data: n
                }), t;
            }
        }, {
            key: "_emitConversationUpdate",
            value: function() {
                var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 1, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 1, n = m(this.conversationMap.values());
                t && this.tim.innerEmitter.emit(wr, n), e && this.tim.outerEmitter.emit(l.CONVERSATION_LIST_UPDATED, n);
            }
        }, {
            key: "_conversationMapTreeShaking",
            value: function(e) {
                var t = this, n = new Map(m(this.conversationMap));
                e.forEach(function(e) {
                    return n.delete(e.conversationID);
                }), n.has(B.CONV_SYSTEM) && n.delete(B.CONV_SYSTEM);
                var r = this.tim.groupController.getJoinedAVChatRoom();
                r && n.delete("".concat(B.CONV_GROUP).concat(r.groupID)), m(n.keys()).forEach(function(e) {
                    return t.conversationMap.delete(e);
                });
            }
        }, {
            key: "reset",
            value: function() {
                this.pagingStatus = zr.NOT_START, this.pagingTimeStamp = 0, this.conversationMap.clear(), 
                this.resetReady(), this.tim.innerEmitter.once(Yn, this._initLocalConversationList, this);
            }
        } ]), n;
    }(), va = function() {
        function t(e) {
            if (a(this, t), void 0 === e) throw new qn({
                code: xe,
                message: Kt
            });
            if (void 0 === e.tim) throw new qn({
                code: xe,
                message: "".concat(Kt, ".tim")
            });
            this.list = new Map(), this.tim = e.tim, this._initializeOptions(e);
        }
        return i(t, [ {
            key: "getLocalOldestMessageByConversationID",
            value: function(e) {
                if (!e) return null;
                if (!this.list.has(e)) return null;
                var t = this.list.get(e).values();
                return t ? t.next().value : null;
            }
        }, {
            key: "_initializeOptions",
            value: function(e) {
                this.options = {};
                var t = {
                    memory: {
                        maxDatasPerKey: 100,
                        maxBytesPerData: 256,
                        maxKeys: 0
                    },
                    cache: {
                        maxDatasPerKey: 10,
                        maxBytesPerData: 256,
                        maxKeys: 0
                    }
                };
                for (var n in t) if (Object.prototype.hasOwnProperty.call(t, n)) {
                    if (void 0 === e[n]) {
                        this.options[n] = t[n];
                        continue;
                    }
                    var r = t[n];
                    for (var o in r) if (Object.prototype.hasOwnProperty.call(r, o)) {
                        if (void 0 === e[n][o]) {
                            this.options[n][o] = r[o];
                            continue;
                        }
                        this.options[n][o] = e[n][o];
                    }
                }
            }
        }, {
            key: "_parseMessageFormLikeKeyValue",
            value: function(e) {
                return [ e.conversationID, e ];
            }
        }, {
            key: "pushIn",
            value: function(e) {
                var t = this._parseMessageFormLikeKeyValue(e), n = 1;
                return void 0 === this.list.get(t[0]) && this.list.set(t[0], new Map()), this.list.has(e.conversationID) && this.list.get(e.conversationID).has(t[1].ID) && (n = 0), 
                this.list.get(t[0]).set(t[1].ID, t[1]), n;
            }
        }, {
            key: "shiftIn",
            value: function(e) {
                Array.isArray(e) ? 0 !== e.length && this._shiftInMultipleMessages(e) : this._shiftSingleMessage(e);
            }
        }, {
            key: "_shiftSingleMessage",
            value: function(e) {
                var t = this._parseMessageFormLikeKeyValue(e);
                if (void 0 === this.list.get(t[0])) return this.list.set(t[0], new Map()), void this.list.get(t[0]).set(t[1].ID, t[1]);
                var n = Array.from(this.list.get(t[0]));
                n.unshift([ t[1].ID, t[1] ]), this.list.set(t[0], new Map(n));
            }
        }, {
            key: "_shiftInMultipleMessages",
            value: function(e) {
                for (var t = e.length, n = [], r = e[0].conversationID, o = this.list.has(r) ? Array.from(this.list.get(r)) : [], i = 0; i < t; i++) n.push([ e[i].ID, e[i] ]);
                this.list.set(r, new Map(n.concat(o)));
            }
        }, {
            key: "remove",
            value: function(e) {
                var t = e.conversationID, n = e.ID;
                this.list.has(t) && this.list.get(t).delete(n);
            }
        }, {
            key: "removeByConversationID",
            value: function(e) {
                this.list.has(e) && this.list.delete(e);
            }
        }, {
            key: "hasLocalMessageList",
            value: function(e) {
                return this.list.has(e);
            }
        }, {
            key: "getLocalMessageList",
            value: function(e) {
                return this.hasLocalMessageList(e) ? m(this.list.get(e).values()) : [];
            }
        }, {
            key: "hasLocalMessage",
            value: function(e, t) {
                return this.hasLocalMessageList(e) ? this.list.get(e).has(t) : 0;
            }
        }, {
            key: "getLocalMessage",
            value: function(e, t) {
                return this.hasLocalMessage(e, t) ? this.list.get(e).get(t) : null;
            }
        }, {
            key: "reset",
            value: function() {
                this.list.clear();
            }
        } ]), t;
    }(), _a = function() {
        function t(e) {
            a(this, t), this.tim = e;
        }
        return i(t, [ {
            key: "setMessageRead",
            value: function(e) {
                var t = e.conversationID, n = e.messageID, r = this.tim.conversationController.getLocalConversation(t);
                if (!r || 0 === r.unreadCount) return oo();
                var o = n ? this.tim.messageController.getLocalMessage(t, n) : null;
                switch (r.type) {
                  case B.CONV_C2C:
                    return this._setC2CMessageRead({
                        conversationID: t,
                        lastMessageTime: o ? o.time : r.lastMessage.lastTime
                    });

                  case B.CONV_GROUP:
                    return this._setGroupMessageRead({
                        conversationID: t,
                        lastMessageSeq: o ? o.sequence : r.lastMessage.lastSequence
                    });

                  case B.CONV_SYSTEM:
                    return r.unreadCount = 0, oo();

                  default:
                    return oo();
                }
            }
        }, {
            key: "_setC2CMessageRead",
            value: function(e) {
                var t = this, n = e.conversationID, r = e.lastMessageTime, o = this.tim.messageController.createPackage({
                    name: "conversation",
                    action: "setC2CMessageRead",
                    param: {
                        C2CMsgReaded: {
                            cookie: "",
                            C2CMsgReadedItem: [ {
                                toAccount: n.replace("C2C", ""),
                                lastMessageTime: r
                            } ]
                        }
                    }
                });
                return this._updateIsReadAfterReadReport({
                    conversationID: n,
                    lastMessageTime: r
                }), this._updateUnreadCount(n), this.tim.connectionController.request(o).then(function() {
                    return new no();
                }).catch(function(e) {
                    return t.tim.innerEmitter.emit(Ar, e), Promise.reject(new no(e));
                });
            }
        }, {
            key: "_setGroupMessageRead",
            value: function(e) {
                var t = this, n = e.conversationID, r = e.lastMessageSeq, o = this.tim.messageController.createPackage({
                    name: "conversation",
                    action: "setGroupMessageRead",
                    param: {
                        groupID: n.replace("GROUP", ""),
                        messageReadSeq: r
                    }
                });
                return this._updateIsReadAfterReadReport({
                    conversationID: n,
                    lastMessageSeq: r
                }), this._updateUnreadCount(n), this.tim.connectionController.request(o).then(function() {
                    return new no();
                }).catch(function(e) {
                    return t.tim.innerEmitter.emit(Ar, e), Promise.reject(new no(e));
                });
            }
        }, {
            key: "_updateUnreadCount",
            value: function(e) {
                var t = this.tim, n = t.conversationController, r = t.messageController, o = n.getLocalConversation(e), i = r.getLocalMessageList(e);
                o && (o.unreadCount = i.filter(function(e) {
                    return !e.isRead;
                }).length);
            }
        }, {
            key: "_updateIsReadAfterReadReport",
            value: function(e) {
                var t = e.conversationID, n = e.lastMessageSeq, r = e.lastMessageTime, o = this.tim.messageController.getLocalMessageList(t);
                if (0 !== o.length) for (var i = o.length - 1; 0 <= i; i--) {
                    var s = o[i];
                    if (!(r && s.time > r || n && s.sequence > n)) {
                        if ("in" === s.flow && s.isRead) break;
                        s.isRead = 1;
                    }
                }
            }
        }, {
            key: "updateIsRead",
            value: function(e) {
                var t = this.tim, n = t.conversationController, r = t.messageController, o = n.getLocalConversation(e), i = r.getLocalMessageList(e);
                if (o && 0 !== i.length && [ B.CONV_C2C, B.CONV_GROUP ].includes(o.type)) for (var s = 0; s < i.length - o.unreadCount && !i[s].isRead; s++) i[s].isRead = 1;
            }
        } ]), t;
    }(), Ia = function() {
        function r(e) {
            var t = e.tim, n = e.messageController;
            a(this, r), this.tim = t, this.messageController = n, this.completedMap = new Map(), 
            this._initListener();
        }
        return i(r, [ {
            key: "getMessageList",
            value: function(e) {
                var t = this, n = e.conversationID, r = e.nextReqMessageID, o = e.count;
                if (this.tim.groupController.checkJoinedAVChatRoomByID(n.replace("GROUP", ""))) return oo({
                    messageList: [],
                    nextReqMessageID: "",
                    isCompleted: 1
                });
                (te(o) || 15 < o) && (o = 15);
                var i = this._computeLeftCount({
                    conversationID: n,
                    nextReqMessageID: r
                });
                return this._needGetHistory({
                    conversationID: n,
                    leftCount: i,
                    count: o
                }) ? this.messageController.getHistoryMessages({
                    conversationID: n,
                    count: 20
                }).then(function() {
                    return i = t._computeLeftCount({
                        conversationID: n,
                        nextReqMessageID: r
                    }), new no(t._computeResult({
                        conversationID: n,
                        nextReqMessageID: r,
                        count: o,
                        leftCount: i
                    }));
                }) : oo(this._computeResult({
                    conversationID: n,
                    nextReqMessageID: r,
                    count: o,
                    leftCount: i
                }));
            }
        }, {
            key: "setCompleted",
            value: function(e) {
                this.completedMap.set(e, 1);
            }
        }, {
            key: "deleteCompletedItem",
            value: function(e) {
                this.completedMap.delete(e);
            }
        }, {
            key: "_initListener",
            value: function() {
                var n = this;
                this.tim.innerEmitter.on(br, function() {
                    n.completedMap.set(B.CONV_SYSTEM, 1);
                }), this.tim.innerEmitter.on(Or, function(e) {
                    var t = e.data;
                    n.completedMap.set("".concat(B.CONV_GROUP).concat(t), 1);
                });
            }
        }, {
            key: "_getMessageListSize",
            value: function(e) {
                return this.messageController.getLocalMessageList(e).length;
            }
        }, {
            key: "_needGetHistory",
            value: function(e) {
                var t = e.conversationID, n = e.leftCount, r = e.count, o = this.tim.conversationController.getLocalConversation(t), i = o ? o.type === B.CONV_SYSTEM : 0, s = o ? o.subType === B.GRP_AVCHATROOM : 0;
                return i || s ? 0 : n < r && !this.completedMap.has(t);
            }
        }, {
            key: "_computeResult",
            value: function(e) {
                var t = e.conversationID, n = e.nextReqMessageID, r = e.count, o = e.leftCount, i = this._computeMessageList({
                    conversationID: t,
                    nextReqMessageID: n,
                    count: r
                }), s = this._computeIsCompleted({
                    conversationID: t,
                    leftCount: o,
                    count: r
                });
                return {
                    messageList: i,
                    nextReqMessageID: this._computeNextReqMessageID({
                        messageList: i,
                        isCompleted: s,
                        conversationID: t
                    }),
                    isCompleted: s
                };
            }
        }, {
            key: "_computeNextReqMessageID",
            value: function(e) {
                var t = e.messageList, n = e.isCompleted, r = e.conversationID;
                if (!n) return 0 === t.length ? "" : t[0].ID;
                var o = this.messageController.getLocalMessageList(r);
                return 0 === o.length ? "" : o[0].ID;
            }
        }, {
            key: "_computeMessageList",
            value: function(e) {
                var t = e.conversationID, n = e.nextReqMessageID, r = e.count, o = this.messageController.getLocalMessageList(t), i = this._computeIndexEnd({
                    nextReqMessageID: n,
                    messageList: o
                }), s = this._computeIndexStart({
                    indexEnd: i,
                    count: r
                });
                return o.slice(s, i);
            }
        }, {
            key: "_computeIndexEnd",
            value: function(e) {
                var t = e.messageList, n = void 0 === t ? [] : t, r = e.nextReqMessageID;
                return r ? n.findIndex(function(e) {
                    return e.ID === r;
                }) : n.length;
            }
        }, {
            key: "_computeIndexStart",
            value: function(e) {
                var t = e.indexEnd, n = e.count;
                return n < t ? t - n : 0;
            }
        }, {
            key: "_computeLeftCount",
            value: function(e) {
                var t = e.conversationID, n = e.nextReqMessageID;
                return n ? this.messageController.getLocalMessageList(t).findIndex(function(e) {
                    return e.ID === n;
                }) : this._getMessageListSize(t);
            }
        }, {
            key: "_computeIsCompleted",
            value: function(e) {
                var t = e.conversationID;
                return e.leftCount <= e.count && this.completedMap.has(t) ? 1 : 0;
            }
        }, {
            key: "reset",
            value: function() {
                this.completedMap.clear();
            }
        } ]), r;
    }(), Ca = function e(t) {
        a(this, e), this.value = t, this.next = null;
    }, Ma = function() {
        function t(e) {
            a(this, t), this.MAX_LENGTH = e, this.pTail = null, this.pNodeToDel = null, this.map = new Map(), 
            $.log("SinglyLinkedList init MAX_LENGTH=".concat(this.MAX_LENGTH));
        }
        return i(t, [ {
            key: "pushIn",
            value: function(e) {
                var t = new Ca(e);
                if (this.map.size < this.MAX_LENGTH) null === this.pTail ? (this.pTail = t, this.pNodeToDel = t) : (this.pTail.next = t, 
                this.pTail = t), this.map.set(e, 1); else {
                    var n = this.pNodeToDel;
                    this.pNodeToDel = this.pNodeToDel.next, this.map.delete(n.value), n.next = null, 
                    n = null, this.pTail.next = t, this.pTail = t, this.map.set(e, 1);
                }
            }
        }, {
            key: "has",
            value: function(e) {
                return this.map.has(e);
            }
        }, {
            key: "reset",
            value: function() {
                for (var e; null !== this.pNodeToDel; ) e = this.pNodeToDel, this.pNodeToDel = this.pNodeToDel.next, 
                e.next = null, e = null;
                this.pTail = null, this.map.clear();
            }
        } ]), t;
    }(), Da = function() {
        function t(e) {
            a(this, t), this.tim = e;
        }
        return i(t, [ {
            key: "upload",
            value: function(e) {
                switch (e.type) {
                  case B.MSG_IMAGE:
                    return this._uploadImage(e);

                  case B.MSG_FILE:
                    return this._uploadFile(e);

                  case B.MSG_AUDIO:
                    return this._uploadAudio(e);

                  case B.MSG_VIDEO:
                    return this._uploadVideo(e);

                  default:
                    return Promise.resolve();
                }
            }
        }, {
            key: "_uploadImage",
            value: function(r) {
                var e = this.tim, t = e.uploadController, n = e.messageController, s = r.getElements()[0], o = n.getMessageOptionByID(r.messageID);
                return t.uploadImage({
                    file: o.payload.file,
                    to: o.to,
                    onProgress: function(e) {
                        if (s.updatePercent(e), re(o.onProgress)) try {
                            o.onProgress(e);
                        } catch (e) {
                            return io(new qn({
                                code: je,
                                message: "".concat(Wt)
                            }));
                        }
                    }
                }).then(function(e) {
                    var r, t = e.location, n = e.fileType, o = e.fileSize, i = _e(t);
                    return s.updateImageFormat(n), s.updateImageInfoArray({
                        size: o,
                        url: i
                    }), r = s._imageMemoryURL, E ? new Promise(function(t, e) {
                        wx.getImageInfo({
                            src: r,
                            success: function(e) {
                                t({
                                    width: e.width,
                                    height: e.height
                                });
                            },
                            fail: function() {
                                t({
                                    width: 0,
                                    height: 0
                                });
                            }
                        });
                    }) : R && 9 === P ? Promise.resolve({
                        width: 0,
                        height: 0
                    }) : new Promise(function(e, t) {
                        var n = new Image();
                        n.onload = function() {
                            e({
                                width: this.width,
                                height: this.height
                            }), n = null;
                        }, n.onerror = function() {
                            e({
                                width: 0,
                                height: 0
                            }), n = null;
                        }, n.src = r;
                    });
                }).then(function(e) {
                    var t = e.width, n = e.height;
                    return s.updateImageInfoArray({
                        width: t,
                        height: n
                    }), r;
                });
            }
        }, {
            key: "_uploadFile",
            value: function(r) {
                var e = this.tim, t = e.uploadController, n = e.messageController, o = r.getElements()[0], i = n.getMessageOptionByID(r.messageID);
                return t.uploadFile({
                    file: i.payload.file,
                    to: i.to,
                    onProgress: function(e) {
                        if (o.updatePercent(e), re(i.onProgress)) try {
                            i.onProgress(e);
                        } catch (e) {
                            return io(new qn({
                                code: je,
                                message: "".concat(Wt)
                            }));
                        }
                    }
                }).then(function(e) {
                    var t = e.location, n = _e(t);
                    return o.updateFileUrl(n), r;
                });
            }
        }, {
            key: "_uploadAudio",
            value: function(r) {
                var e = this.tim, t = e.uploadController, n = e.messageController, o = r.getElements()[0], i = n.getMessageOptionByID(r.messageID);
                return t.uploadAudio({
                    file: i.payload.file,
                    to: i.to,
                    onProgress: function(e) {
                        if (o.updatePercent(e), re(i.onProgress)) try {
                            i.onProgress(e);
                        } catch (e) {
                            return io(new qn({
                                code: je,
                                message: "".concat(Wt)
                            }));
                        }
                    }
                }).then(function(e) {
                    var t = e.location, n = _e(t);
                    return o.updateAudioUrl(n), r;
                });
            }
        }, {
            key: "_uploadVideo",
            value: function(e) {
                var t = this.tim, n = t.uploadController, r = t.messageController, o = e.getElements()[0], i = r.getMessageOptionByID(e.messageID);
                return n.uploadVideo({
                    file: i.payload.file,
                    to: i.to,
                    onProgress: function(e) {
                        if (o.updatePercent(e), re(i.onProgress)) try {
                            i.onProgress(e);
                        } catch (e) {
                            return io(new qn({
                                code: je,
                                message: "".concat(Wt)
                            }));
                        }
                    }
                }).then(function(e) {
                    if (E) {
                        var t = _e(e.location);
                        o.updateVideoUrl(t);
                    }
                }).catch(function() {
                    return io(new qn({
                        code: We,
                        message: "".concat(tn)
                    }));
                });
            }
        } ]), t;
    }(), Sa = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initializeMembers(), t._initializeListener(), 
            t._initialzeHandlers(), t.messageOptionMap = new Map(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initializeMembers",
            value: function() {
                this.messagesList = new va({
                    tim: this.tim
                }), this.currentMessageKey = {}, this.singlyLinkedList = new Ma(100);
            }
        }, {
            key: "_initialzeHandlers",
            value: function() {
                this.readReportHandler = new _a(this.tim), this.getMessageHandler = new Ia({
                    messageController: this,
                    tim: this.tim
                }), this.uploadFileHandler = new Da(this.tim);
            }
        }, {
            key: "reset",
            value: function() {
                this.messagesList.reset(), this.currentMessageKey = {}, this.getMessageHandler.reset(), 
                this.singlyLinkedList.reset(), this.messageOptionMap.clear();
            }
        }, {
            key: "_initializeListener",
            value: function() {
                var e = this.tim.innerEmitter;
                e.on(dr, this._onReceiveC2CMessage, this), e.on(Wn, this._onSyncMessagesProcessing, this), 
                e.on(Xn, this._onSyncMessagesFinished, this), e.on(mr, this._onReceiveGroupMessage, this), 
                e.on(yr, this._onReceiveGroupTips, this), e.on(vr, this._onReceiveSystemNotice, this), 
                e.on(Rr, this._clearConversationMessages, this);
            }
        }, {
            key: "sendMessageInstance",
            value: function(t) {
                var n, o = this, e = this.tim, r = e.innerEmitter, i = e.sumStatController, s = null;
                switch (r.emit(Jn, {
                    data: {
                        eventDataList: [ {
                            conversationID: t.conversationID,
                            unreadCount: 0,
                            type: t.conversationType,
                            subType: t.conversationSubType,
                            lastMessage: t
                        } ]
                    }
                }), t.conversationType) {
                  case B.CONV_C2C:
                    s = this._handleOnSendC2CMessageSuccess.bind(this);
                    break;

                  case B.CONV_GROUP:
                    s = this._handleOnSendGroupMessageSuccess.bind(this);
                    break;

                  default:
                    return io(new qn({
                        code: Be,
                        message: zt
                    }));
                }
                return this.singlyLinkedList.pushIn(t.random), this.uploadFileHandler.upload(t).then(function() {
                    var e = null;
                    return t.isSendable() ? (i.addTotalCount(lo), n = Date.now(), t.conversationType === B.CONV_C2C ? e = o._createC2CMessagePack(t) : t.conversationType === B.CONV_GROUP && (e = o._createGroupMessagePack(t)), 
                    o.tim.connectionController.request(e)) : io({
                        code: tt,
                        message: un
                    });
                }).then(function(e) {
                    return i.addSuccessCount(lo), i.addCost(lo, Math.abs(Date.now() - n)), t.conversationType === B.CONV_GROUP && (t.sequence = e.data.sequence, 
                    t.time = e.data.time, t.generateMessageID(o.tim.context.identifier)), o.messagesList.pushIn(t), 
                    s(t, e.data), o.messageOptionMap.delete(t.messageID), new no({
                        message: t
                    });
                }).catch(function(n) {
                    t.status = jr.FAIL;
                    var r = new go();
                    return r.setMethod(Co).setMessageType(t.type).setText("".concat(o._generateTjgID(t), "-").concat(t.type, "-").concat(t.from, "-").concat(t.to)).setStart(), 
                    o.probeNetwork().then(function(e, t) {
                        r.setError(n, e, t).setEnd();
                    }), $.error("MessageController.sendMessageInstance error:", n), io(new qn({
                        code: n && n.code ? n.code : Ue,
                        message: n && n.message ? n.message : jt,
                        data: {
                            message: t
                        }
                    }));
                });
            }
        }, {
            key: "resendMessage",
            value: function(e) {
                return e.isResend = 1, e.status = jr.UNSEND, this.sendMessageInstance(e);
            }
        }, {
            key: "_isFileLikeMessage",
            value: function(e) {
                return 0 <= [ B.MSG_IMAGE, B.MSG_FILE, B.MSG_AUDIO, B.MSG_VIDEO ].indexOf(e.type) ? 1 : 0;
            }
        }, {
            key: "_resendBinaryTypeMessage",
            value: function() {}
        }, {
            key: "_createC2CMessagePack",
            value: function(e) {
                return this.createPackage({
                    name: "c2cMessage",
                    action: "create",
                    tjgID: this._generateTjgID(e),
                    param: {
                        toAccount: e.to,
                        msgBody: e.getElements(),
                        msgSeq: e.sequence,
                        msgRandom: e.random
                    }
                });
            }
        }, {
            key: "_handleOnSendC2CMessageSuccess",
            value: function(e, t) {
                var n = this.tim.innerEmitter;
                e.status = jr.SUCCESS, e.time = t.time, n.emit(Qn, {
                    data: {
                        eventDataList: [ {
                            conversationID: e.conversationID,
                            unreadCount: 0,
                            type: e.conversationType,
                            subType: e.conversationSubType,
                            lastMessage: e
                        } ]
                    }
                });
            }
        }, {
            key: "_createGroupMessagePack",
            value: function(e) {
                return this.createPackage({
                    name: "groupMessage",
                    action: "create",
                    tjgID: this._generateTjgID(e),
                    param: {
                        groupID: e.to,
                        msgBody: e.getElements(),
                        random: e.random,
                        clientSequence: e.clientSequence
                    }
                });
            }
        }, {
            key: "_handleOnSendGroupMessageSuccess",
            value: function(e, t) {
                var n = this.tim.innerEmitter;
                e.sequence = t.sequence, e.time = t.time, e.status = jr.SUCCESS, n.emit(nr, {
                    data: {
                        eventDataList: [ {
                            conversationID: e.conversationID,
                            unreadCount: 0,
                            type: e.conversationType,
                            subType: e.conversationSubType,
                            lastMessage: e
                        } ]
                    }
                });
            }
        }, {
            key: "_onReceiveC2CMessage",
            value: function(e) {
                var t = this.tim, n = t.innerEmitter, r = t.outerEmitter;
                $.log("MessageController._onReceiveC2CMessage(), get new messages");
                var o = this._newC2CMessageStoredAndSummary({
                    notifiesList: e.data,
                    type: B.CONV_C2C,
                    C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }), i = o.eventDataList, s = o.result;
                0 < i.length && n.emit(tr, {
                    data: {
                        eventDataList: i,
                        result: s
                    },
                    resource: this
                }), 0 < s.length && r.emit(l.MESSAGE_RECEIVED, s);
            }
        }, {
            key: "_onReceiveGroupMessage",
            value: function(e) {
                var t = this.tim, n = t.outerEmitter, r = t.innerEmitter, o = this.newGroupMessageStoredAndSummary(e.data), i = o.eventDataList, s = o.result;
                0 < i.length && ($.log("MessageController._onReceiveGroupMessage()"), r.emit(rr, {
                    data: {
                        eventDataList: i,
                        result: s,
                        isGroupTip: 0
                    }
                })), 0 < s.length && n.emit(l.MESSAGE_RECEIVED, s);
            }
        }, {
            key: "_onReceiveGroupTips",
            value: function(e) {
                var t = this.tim, n = t.outerEmitter, r = t.innerEmitter, o = e.data, i = this.newGroupTipsStoredAndSummary(o), s = i.eventDataList, a = i.result;
                $.log("MessageController._onReceiveGroupTips()"), 0 < s.length && r.emit(rr, {
                    data: {
                        eventDataList: s,
                        result: a,
                        isGroupTip: 1
                    }
                }), 0 < a.length && n.emit(l.MESSAGE_RECEIVED, a);
            }
        }, {
            key: "_onReceiveSystemNotice",
            value: function(e) {
                var t = this.tim, n = t.outerEmitter, r = t.innerEmitter, o = e.data, i = o.groupSystemNotices, s = o.type, a = this.newSystemNoticeStoredAndSummary({
                    notifiesList: i,
                    type: s
                }), u = a.eventDataList, c = a.result;
                0 < u.length && r.emit(or, {
                    data: {
                        eventDataList: u,
                        result: c,
                        type: s
                    }
                }), 0 < c.length && "poll" === s && n.emit(l.MESSAGE_RECEIVED, c);
            }
        }, {
            key: "_clearConversationMessages",
            value: function(e) {
                this.messagesList.removeByConversationID(e), this.getMessageHandler.deleteCompletedItem(e);
            }
        }, {
            key: "_pushIntoNoticeResult",
            value: function(e, t) {
                var n = this.messagesList.pushIn(t), r = this.singlyLinkedList.has(t.random);
                return n && 0 == r ? (e.push(t), 1) : 0;
            }
        }, {
            key: "_newC2CMessageStoredAndSummary",
            value: function(e) {
                for (var t = e.notifiesList, n = e.type, r = e.C2CRemainingUnreadList, o = e.isFromSync, i = null, s = [], a = [], u = {}, c = this.tim.bigDataHallwayController, l = 0, p = t.length; l < p; l++) {
                    var h = t[l];
                    (h.currentUser = this.tim.context.identifier, h.conversationType = n, h.isSystemMessage = !!h.isSystemMessage, 
                    i = new ha(h), h.elements = c.parseElements(h.elements, h.from), i.setElement(h.elements), 
                    o || this._pushIntoNoticeResult(a, i)) && (void 0 === u[i.conversationID] ? u[i.conversationID] = s.push({
                        conversationID: i.conversationID,
                        unreadCount: "out" === i.flow ? 0 : 1,
                        type: i.conversationType,
                        subType: i.conversationSubType,
                        lastMessage: i
                    }) - 1 : (s[u[i.conversationID]].type = i.conversationType, s[u[i.conversationID]].subType = i.conversationSubType, 
                    "in" === (s[u[i.conversationID]].lastMessage = i).flow && s[u[i.conversationID]].unreadCount++));
                }
                if (ee(r)) for (var f = function(t, e) {
                    var n = s.find(function(e) {
                        return e.conversationID === "C2C".concat(r[t].from);
                    });
                    n ? n.unreadCount += r[t].count : s.push({
                        conversationID: "C2C".concat(r[t].from),
                        unreadCount: r[t].count,
                        type: B.CONV_C2C
                    });
                }, g = 0, d = r.length; g < d; g++) f(g);
                return {
                    eventDataList: s,
                    result: a
                };
            }
        }, {
            key: "newGroupMessageStoredAndSummary",
            value: function(e) {
                for (var t = null, n = [], r = {}, o = [], i = B.CONV_GROUP, s = this.tim.bigDataHallwayController, a = 0, u = e.length; a < u; a++) {
                    var c = e[a];
                    c.currentUser = this.tim.context.identifier, c.conversationType = i, c.isSystemMessage = !!c.isSystemMessage, 
                    t = new ha(c), c.elements = s.parseElements(c.elements, c.from), t.setElement(c.elements), 
                    this._pushIntoNoticeResult(o, t) && (void 0 === r[t.conversationID] ? r[t.conversationID] = n.push({
                        conversationID: t.conversationID,
                        unreadCount: "out" === t.flow ? 0 : 1,
                        type: t.conversationType,
                        subType: t.conversationSubType,
                        lastMessage: t
                    }) - 1 : (n[r[t.conversationID]].type = t.conversationType, n[r[t.conversationID]].subType = t.conversationSubType, 
                    "in" === (n[r[t.conversationID]].lastMessage = t).flow && n[r[t.conversationID]].unreadCount++));
                }
                return {
                    eventDataList: n,
                    result: o
                };
            }
        }, {
            key: "newGroupTipsStoredAndSummary",
            value: function(e) {
                for (var t = null, n = [], r = [], o = {}, i = 0, s = e.length; i < s; i++) {
                    var a = e[i];
                    a.currentUser = this.tim.context.identifier, a.conversationType = B.CONV_GROUP, 
                    (t = new ha(a)).setElement({
                        type: B.MSG_GRP_TIP,
                        content: H({}, a.elements, {
                            groupProfile: a.groupProfile
                        })
                    }), t.isSystemMessage = 0, this._pushIntoNoticeResult(r, t) && (void 0 === o[t.conversationID] ? o[t.conversationID] = n.push({
                        conversationID: t.conversationID,
                        unreadCount: "out" === t.flow ? 0 : 1,
                        type: t.conversationType,
                        subType: t.conversationSubType,
                        lastMessage: t
                    }) - 1 : (n[o[t.conversationID]].type = t.conversationType, n[o[t.conversationID]].subType = t.conversationSubType, 
                    "in" === (n[o[t.conversationID]].lastMessage = t).flow && n[o[t.conversationID]].unreadCount++));
                }
                return {
                    eventDataList: n,
                    result: r
                };
            }
        }, {
            key: "newSystemNoticeStoredAndSummary",
            value: function(e) {
                var t = e.notifiesList, n = e.type, r = null, o = t.length, i = 0, s = [], a = {
                    conversationID: B.CONV_SYSTEM,
                    unreadCount: 0,
                    type: B.CONV_SYSTEM,
                    subType: null,
                    lastMessage: null
                };
                for (i = 0; i < o; i++) {
                    var u = t[i];
                    15 !== u.elements.operationType && (u.currentUser = this.tim.context.identifier, 
                    u.conversationType = B.CONV_SYSTEM, u.conversationID = B.CONV_SYSTEM, (r = new ha(u)).setElement({
                        type: B.MSG_GRP_SYS_NOTICE,
                        content: H({}, u.elements, {
                            groupProfile: u.groupProfile
                        })
                    }), r.isRead = 1, r.isSystemMessage = 1, this._pushIntoNoticeResult(s, r) && ("poll" === n && a.unreadCount++, 
                    a.subType = r.conversationSubType));
                }
                return a.lastMessage = s[s.length - 1], {
                    eventDataList: 0 < s.length ? [ a ] : [],
                    result: s
                };
            }
        }, {
            key: "_onSyncMessagesProcessing",
            value: function(e) {
                var t = this._newC2CMessageStoredAndSummary({
                    notifiesList: e.data,
                    type: B.CONV_C2C,
                    isFromSync: 1,
                    C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }), n = t.eventDataList, r = t.result;
                this.tim.innerEmitter.emit(Zn, {
                    data: {
                        eventDataList: n,
                        result: r
                    },
                    resource: this
                });
            }
        }, {
            key: "_onSyncMessagesFinished",
            value: function(e) {
                this.triggerReady();
                var t = this._newC2CMessageStoredAndSummary({
                    notifiesList: e.data,
                    type: B.CONV_C2C,
                    isFromSync: 1,
                    C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }), n = t.eventDataList, r = t.result;
                this.tim.innerEmitter.emit(er, {
                    data: {
                        eventDataList: n,
                        result: r
                    },
                    resource: this
                });
            }
        }, {
            key: "getHistoryMessages",
            value: function(e) {
                if (e.conversationID === B.CONV_SYSTEM) return oo();
                !e.count && (e.count = 15), 20 < e.count && (e.count = 20);
                var t = this.messagesList.getLocalOldestMessageByConversationID(e.conversationID);
                t || ((t = {}).time = 0, (t.sequence = 0) === e.conversationID.indexOf(B.CONV_C2C) ? (t.to = e.conversationID.replace(B.CONV_C2C, ""), 
                t.conversationType = B.CONV_C2C) : 0 === e.conversationID.indexOf(B.CONV_GROUP) && (t.to = e.conversationID.replace(B.CONV_GROUP, ""), 
                t.conversationType = B.CONV_GROUP));
                var n = "";
                switch (t.conversationType) {
                  case B.CONV_C2C:
                    return n = e.conversationID.replace(B.CONV_C2C, ""), this.getC2CRoamMessages({
                        conversationID: e.conversationID,
                        peerAccount: n,
                        count: e.count,
                        lastMessageTime: void 0 === this.currentMessageKey[e.conversationID] ? 0 : t.time
                    });

                  case B.CONV_GROUP:
                    return this.getGroupRoamMessages({
                        conversationID: e.conversationID,
                        groupID: t.to,
                        count: e.count,
                        sequence: t.sequence - 1
                    });

                  default:
                    return oo();
                }
            }
        }, {
            key: "getC2CRoamMessages",
            value: function(i) {
                var s = this, e = this.tim, t = e.connectionController, n = e.innerEmitter, r = void 0 !== this.currentMessageKey[i.conversationID] ? this.currentMessageKey[i.conversationID] : "", o = this.createPackage({
                    name: "c2cMessage",
                    action: "query",
                    param: {
                        peerAccount: i.peerAccount,
                        count: i.count || 15,
                        lastMessageTime: i.lastMessageTime || 0,
                        messageKey: r
                    }
                });
                return t.request(o).then(function(e) {
                    var t = e.data, n = t.complete, r = t.messageList;
                    1 === n && s.getMessageHandler.setCompleted(i.conversationID);
                    var o = s._roamMessageStore(r, B.CONV_C2C, i.conversationID);
                    return s.readReportHandler.updateIsRead(i.conversationID), s.currentMessageKey[i.conversationID] = e.data.messageKey, 
                    o;
                }).catch(function(e) {
                    return n.emit(Ar, e), Promise.reject(e);
                });
            }
        }, {
            key: "getC2CRoamMessagesSliced",
            value: function(e) {
                var n, u = this.tim.connectionController, c = this;
                return n = e, new Promise(function(e, t) {
                    !function r(o, i, s) {
                        var a = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : [], e = c.createPackage({
                            name: "c2cMessage",
                            action: "query",
                            param: {
                                peerAccount: o.peerAccount,
                                count: o.count || 15,
                                lastMessageTime: o.lastMessageTime || 0,
                                messageKey: o.messageKey || ""
                            }
                        });
                        return u.request(e).then(function(e) {
                            var t = e.data.messageList, n = c._roamMessageStore(t, B.CONV_C2C);
                            a.push.apply(a, m(n)), e.data.complete === Vr.C2C_IS_NOT_FINISHED ? (o.messageKey = e.data.messageKey, 
                            r(o, i, a)) : e.data.complete === Vr.C2C_IS_FINISHED ? ($.log("getC2CRoamMessages finised..."), 
                            i(new no(a))) : s(new qn({
                                code: qe,
                                message: Vt
                            }));
                        }).reject(function(e) {
                            $.log("getC2CRoamMessages fail..."), s(e);
                        });
                    }(n, e, t, []);
                });
            }
        }, {
            key: "getGroupRoamMessages",
            value: function(s) {
                var a = this, e = this.tim, t = e.connectionController, n = e.groupController, r = 0 <= s.sequence ? s.sequence : n.getLocalGroupLastSequence(s.groupID);
                if (r < 0) return oo([]);
                var o = this.createPackage({
                    name: "groupMessage",
                    action: "query",
                    param: {
                        groupID: s.groupID,
                        count: 21,
                        sequence: r
                    }
                });
                return t.request(o).then(function(e) {
                    var t = e.data, n = t.messageList, r = t.complete, o = "GROUP".concat(s.groupID);
                    if (2 === r || ke(n)) return a.getMessageHandler.setCompleted(o), [];
                    var i = a._roamMessageStore(n, B.CONV_GROUP, o);
                    return a.readReportHandler.updateIsRead(o), $.log("getGroupRoamMessages finished..."), 
                    i;
                }).catch(function(e) {
                    return a.tim.exceptionController.ask(e), $.log("getGroupRoamMessages error..."), 
                    Promise.reject(e);
                });
            }
        }, {
            key: "_roamMessageStore",
            value: function() {
                var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [], t = 1 < arguments.length ? arguments[1] : void 0, n = 2 < arguments.length ? arguments[2] : void 0, r = null, o = [], i = 0, s = e.length, a = null, u = t === B.CONV_GROUP, c = this.tim.bigDataHallwayController, l = function() {
                    i = u ? e.length - 1 : 0, s = u ? 0 : e.length;
                }, p = function() {
                    u ? --i : ++i;
                }, h = function() {
                    return u ? s <= i : i < s;
                };
                for (l(); h(); p()) u && 1 === e[i].sequence && this.getMessageHandler.setCompleted(n), 
                e[i].isPlaceMessage || ((r = new ha(e[i])).to = e[i].to, r.isSystemMessage = !!e[i].isSystemMessage, 
                r.conversationType = t, e[i].event === Jr.JSON.TYPE.GROUP.TIP ? a = {
                    type: B.MSG_GRP_TIP,
                    content: H({}, e[i].elements, {
                        groupProfile: e[i].groupProfile
                    })
                } : (e[i].elements = c.parseElements(e[i].elements, e[i].from), a = e[i].elements[0]), 
                r.setElement(a), r.reInitialize(this.tim.context.identifier), o.push(r));
                return this.messagesList.shiftIn(o), l = p = h = null, o;
            }
        }, {
            key: "getLocalMessageList",
            value: function(e) {
                return this.messagesList.getLocalMessageList(e);
            }
        }, {
            key: "getLocalMessage",
            value: function(e, t) {
                return this.messagesList.getLocalMessage(e, t);
            }
        }, {
            key: "hasLocalMessage",
            value: function(e, t) {
                return this.messagesList.hasLocalMessage(e, t);
            }
        }, {
            key: "deleteLocalMessage",
            value: function(e) {
                e instanceof ha && this.messagesList.remove(e);
            }
        }, {
            key: "setMessageRead",
            value: function(n) {
                var r = this;
                return new Promise(function(e, t) {
                    r.ready(function() {
                        r.readReportHandler.setMessageRead(n).then(e).catch(t);
                    });
                });
            }
        }, {
            key: "getMessageList",
            value: function(e) {
                return this.getMessageHandler.getMessageList(e);
            }
        }, {
            key: "createTextMessage",
            value: function(e) {
                e.currentUser = this.tim.context.identifier;
                var t = new ha(e), n = "string" == typeof e.payload ? e.payload : e.payload.text, r = new ea({
                    text: n
                });
                return t.setElement(r), t;
            }
        }, {
            key: "createCustomMessage",
            value: function(e) {
                e.currentUser = this.tim.context.identifier;
                var t = new ha(e), n = new ca({
                    data: e.payload.data,
                    description: e.payload.description,
                    extension: e.payload.extension
                });
                return t.setElement(n), t;
            }
        }, {
            key: "createImageMessage",
            value: function(e) {
                e.currentUser = this.tim.context.identifier;
                var t = new ha(e);
                if (E) {
                    var n = e.payload.file;
                    if (W(n)) return void $.warn("微信小程序环境下调用 createImageMessage 接口时，payload.file 不支持传入 File 对象");
                    var r = n.tempFilePaths[0], o = {
                        url: r,
                        name: r.slice(r.lastIndexOf("/") + 1),
                        size: n.tempFiles[0].size,
                        type: r.slice(r.lastIndexOf(".") + 1).toLowerCase()
                    };
                    e.payload.file = o;
                } else if (T) {
                    if (te(e.payload.file)) return void $.warn("createImageMessage, payload.file 是 undefined，请检查代码！");
                    if (W(e.payload.file)) {
                        var i = e.payload.file;
                        e.payload.file = {
                            files: [ i ]
                        };
                    }
                }
                e.onProgress = De(e.onProgress);
                var s = new ta({
                    imageFormat: "UNKNOWN",
                    uuid: this._generateUUID(),
                    file: e.payload.file
                });
                return t.setElement(s), this.messageOptionMap.set(t.messageID, e), t;
            }
        }, {
            key: "createFileMessage",
            value: function(e) {
                if (!E) {
                    if (T) {
                        if (te(e.payload.file)) return void $.warn("createFileMessage, payload.file 是 undefined，请检查代码！");
                        if (W(e.payload.file)) {
                            var t = e.payload.file;
                            e.payload.file = {
                                files: [ t ]
                            };
                        }
                    }
                    e.currentUser = this.tim.context.identifier, e.onProgress = De(e.onProgress);
                    var n = new ha(e), r = new ua({
                        uuid: this._generateUUID(),
                        file: e.payload.file
                    });
                    return n.setElement(r), this.messageOptionMap.set(n.messageID, e), n;
                }
                $.warn("微信小程序目前不支持选择文件， createFileMessage 接口不可用！");
            }
        }, {
            key: "createAudioMessage",
            value: function(e) {
                if (E) {
                    var t = e.payload.file;
                    if (E) {
                        var n = {
                            url: t.tempFilePath,
                            name: t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/") + 1),
                            size: t.fileSize,
                            second: parseInt(t.duration) / 1e3,
                            type: t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".") + 1).toLowerCase()
                        };
                        e.payload.file = n;
                    }
                    e.currentUser = this.tim.context.identifier, e.onProgress = De(e.onProgress);
                    var r = new ha(e), o = new ra({
                        second: Math.floor(t.duration / 1e3),
                        size: t.fileSize,
                        url: t.tempFilePath,
                        uuid: this._generateUUID()
                    });
                    return r.setElement(o), this.messageOptionMap.set(r.messageID, e), r;
                }
                $.warn("createAudioMessage 目前只支持微信小程序发语音消息");
            }
        }, {
            key: "createVideoMessage",
            value: function(e) {
                if (E) {
                    if (e.currentUser = this.tim.context.identifier, E) {
                        e.payload.file.thumbUrl = "https://webim-1252463788.cos.ap-shanghai.myqcloud.com/assets/images/transparent.png", 
                        e.payload.file.thumbSize = 1668;
                        var t = e.payload.file, n = {
                            url: t.tempFilePath,
                            name: t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/") + 1),
                            size: t.size,
                            second: t.duration,
                            type: t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".") + 1).toLowerCase()
                        };
                        e.payload.file.videoFile = n, e.onProgress = De(e.onProgress);
                        var r = new ha(e), o = new la({
                            videoFormat: n.type,
                            videoSecond: Number(n.second.toFixed(0)),
                            videoSize: n.size,
                            remoteVideoUrl: "",
                            videoUrl: n.url,
                            videoUUID: this._generateUUID(),
                            thumbUUID: this._generateUUID(),
                            thumbWidth: t.width,
                            thumbHeight: t.height,
                            thumbUrl: t.thumbUrl,
                            thumbSize: t.thumbSize,
                            thumbFormat: t.thumbUrl.slice(t.thumbUrl.lastIndexOf(".") + 1).toLowerCase()
                        });
                        return r.setElement(o), this.messageOptionMap.set(r.messageID, e), r;
                    }
                } else $.warn("createVideoMessage 目前只支持微信小程序发视频消息");
            }
        }, {
            key: "createFaceMessage",
            value: function(e) {
                e.currentUser = this.tim.context.identifier;
                var t = new ha(e), n = new na(e.payload);
                return t.setElement(n), t;
            }
        }, {
            key: "_generateUUID",
            value: function() {
                var e = this.tim.context;
                return "".concat(e.SDKAppID, "-").concat(e.identifier, "-").concat(function() {
                    for (var e = "", t = 32; 0 < t; --t) e += ge[Math.floor(Math.random() * de)];
                    return e;
                }());
            }
        }, {
            key: "_generateTjgID",
            value: function(e) {
                return this.tim.context.tinyID + "-" + e.random;
            }
        }, {
            key: "getMessageOptionByID",
            value: function(e) {
                return this.messageOptionMap.get(e);
            }
        } ]), n;
    }(), ka = function() {
        function t(e) {
            a(this, t), this.userID = "", this.avatar = "", this.nick = "", this.role = "", 
            this.joinTime = "", this.lastSendMsgTime = "", this.nameCard = "", this.muteUntil = 0, 
            this.memberCustomField = [], this._initMember(e);
        }
        return i(t, [ {
            key: "_initMember",
            value: function(e) {
                this.updateMember(e);
            }
        }, {
            key: "updateMember",
            value: function(e) {
                ce(this, e, [], [ null, void 0, "", 0, NaN ]);
            }
        }, {
            key: "updateRole",
            value: function(e) {
                [ "Owner", "Admin", "Member" ].indexOf(e) < 0 || (this.role = e);
            }
        }, {
            key: "updateMemberCustomField",
            value: function(e) {
                ce(this.memberCustomField, e);
            }
        } ]), t;
    }(), Ta = function() {
        function t(e) {
            a(this, t), this.tim = e.tim, this.groupController = e.groupController, this._initListeners();
        }
        return i(t, [ {
            key: "_initListeners",
            value: function() {
                this.tim.innerEmitter.on(rr, this._onReceivedGroupTips, this);
            }
        }, {
            key: "_onReceivedGroupTips",
            value: function(e) {
                var t = this, n = e.data, r = n.result;
                n.isGroupTip && r.forEach(function(e) {
                    switch (e.payload.operationType) {
                      case 1:
                        t._onNewMemberComeIn(e);
                        break;

                      case 2:
                        t._onMemberQuit(e);
                        break;

                      case 3:
                        t._onMemberKickedOut(e);
                        break;

                      case 4:
                        t._onMemberSetAdmin(e);
                        break;

                      case 5:
                        t._onMemberCancelledAdmin(e);
                        break;

                      case 6:
                        t._onGroupProfileModified(e);
                        break;

                      case 7:
                        t._onMemberInfoModified(e);
                        break;

                      default:
                        $.warn("GroupTipsHandler._onReceivedGroupTips Unhandled groupTips. operationType=", e.payload.operationType);
                    }
                });
            }
        }, {
            key: "_onNewMemberComeIn",
            value: function(e) {
                var t = e.payload, n = t.memberNum, r = t.groupProfile.groupID, o = this.groupController.getLocalGroupProfile(r);
                o && X(n) && (o.memberNum = n);
            }
        }, {
            key: "_onMemberQuit",
            value: function(e) {
                var t = e.payload, n = t.memberNum, r = t.groupProfile.groupID, o = this.groupController.getLocalGroupProfile(r);
                o && X(n) && (o.memberNum = n), this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList);
            }
        }, {
            key: "_onMemberKickedOut",
            value: function(e) {
                var t = e.payload, n = t.memberNum, r = t.groupProfile.groupID, o = this.groupController.getLocalGroupProfile(r);
                o && X(n) && (o.memberNum = n), this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList);
            }
        }, {
            key: "_onMemberSetAdmin",
            value: function(e) {
                var n = this, r = e.payload.groupProfile.groupID;
                e.payload.userIDList.forEach(function(e) {
                    var t = n.groupController.getLocalGroupMemberInfo(r, e);
                    t && t.updateRole(B.GRP_MBR_ROLE_ADMIN);
                });
            }
        }, {
            key: "_onMemberCancelledAdmin",
            value: function(e) {
                var n = this, r = e.payload.groupProfile.groupID;
                e.payload.userIDList.forEach(function(e) {
                    var t = n.groupController.getLocalGroupMemberInfo(r, e);
                    t && t.updateRole(B.GRP_MBR_ROLE_MEMBER);
                });
            }
        }, {
            key: "_onGroupProfileModified",
            value: function(e) {
                var t = this, n = e.payload.newGroupProfile, r = e.payload.groupProfile.groupID, o = this.groupController.getLocalGroupProfile(r);
                Object.keys(n).forEach(function(e) {
                    switch (e) {
                      case "ownerID":
                        t._ownerChaged(o, n);
                        break;

                      default:
                        o[e] = n[e];
                    }
                }), this.groupController.emitGroupListUpdate(1, 1);
            }
        }, {
            key: "_ownerChaged",
            value: function(e, t) {
                var n = e.groupID, r = this.groupController.getLocalGroupProfile(n), o = this.tim.context.identifier;
                if (o === t.ownerID) {
                    r.updateGroup({
                        selfInfo: {
                            role: B.GRP_MBR_ROLE_OWNER
                        }
                    });
                    var i = this.groupController.getLocalGroupMemberInfo(n, o), s = this.groupController.getLocalGroupProfile(n).ownerID, a = this.groupController.getLocalGroupMemberInfo(n, s);
                    i && i.updateRole(B.GRP_MBR_ROLE_OWNER), a && a.updateRole(B.GRP_MBR_ROLE_MEMBER);
                }
            }
        }, {
            key: "_onMemberInfoModified",
            value: function(e) {
                var n = this, r = e.payload.groupProfile.groupID;
                e.payload.msgMemberInfo.forEach(function(e) {
                    var t = n.groupController.getLocalGroupMemberInfo(r, e.userAccount);
                    t && e.shutupTime && (t.shutUpUntil = (Date.now() + 1e3 * e.shutupTime) / 1e3);
                });
            }
        } ]), t;
    }(), Ea = function() {
        function t(e) {
            a(this, t), this.groupController = e.groupController, this.tim = e.tim, this.pendencyMap = new Map(), 
            this._initLiceners();
        }
        return i(t, [ {
            key: "_initLiceners",
            value: function() {
                this.tim.innerEmitter.on(or, this._onReceivedGroupSystemNotice, this), this.tim.innerEmitter.on(Xn, this._clearGroupSystemNotice, this);
            }
        }, {
            key: "_clearGroupSystemNotice",
            value: function() {
                var u = this;
                this.getPendencyList().then(function(e) {
                    e.forEach(function(e) {
                        u.pendencyMap.set("".concat(e.from, "_").concat(e.groupID, "_").concat(e.to), e);
                    });
                    var t = u.tim.messageController.getLocalMessageList(B.CONV_SYSTEM), a = [];
                    t.forEach(function(e) {
                        var t = e.payload, n = t.operatorID, r = t.operationType, o = t.groupProfile;
                        if (1 === r) {
                            var i = "".concat(n, "_").concat(o.groupID, "_").concat(o.to), s = u.pendencyMap.get(i);
                            s && X(s.handled) && 0 !== s.handled && a.push(e);
                        }
                    }), u.groupController.deleteGroupSystemNotice({
                        messageList: a
                    });
                });
            }
        }, {
            key: "getPendencyList",
            value: function(e) {
                var r = this, t = this.groupController.createPackage({
                    name: "group",
                    action: "getGroupPendency",
                    param: {
                        startTime: e && e.startTime ? e.startTime : 0,
                        limit: e && e.limit ? e.limit : 10,
                        handleAccount: this.tim.context.identifier
                    }
                });
                return this.groupController.connectionController.request(t).then(function(e) {
                    var t = e.data, n = t.pendencyList;
                    return 0 !== t.nextStartTime ? r.getPendencyList({
                        startTime: t.nextStartTime
                    }).then(function(e) {
                        return [].concat(m(n), m(e));
                    }) : n;
                });
            }
        }, {
            key: "_onReceivedGroupSystemNotice",
            value: function(e) {
                var t = this, n = e.data, r = n.result;
                "sync" !== n.type && r.forEach(function(e) {
                    switch (e.payload.operationType) {
                      case 1:
                        t._onApplyGroupRequest(e);
                        break;

                      case 2:
                        t._onApplyGroupRequestAgreed(e);
                        break;

                      case 3:
                        t._onApplyGroupRequestRefused(e);
                        break;

                      case 4:
                        t._onMemberKicked(e);
                        break;

                      case 5:
                        t._onGroupDismissed(e);
                        break;

                      case 6:
                        break;

                      case 7:
                        t._onInviteGroup(e);
                        break;

                      case 8:
                        t._onQuitGroup(e);
                        break;

                      case 9:
                        t._onSetManager(e);
                        break;

                      case 10:
                        t._onDeleteManager(e);
                        break;

                      case 11:
                      case 12:
                      case 15:
                        break;

                      case 255:
                        t.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                            message: e,
                            type: 255
                        });
                    }
                });
            }
        }, {
            key: "_onApplyGroupRequest",
            value: function(e) {
                this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 1
                });
            }
        }, {
            key: "_onApplyGroupRequestAgreed",
            value: function(e) {
                var n = this, t = e.payload.groupProfile.groupID;
                this.groupController.hasLocalGroup(t) || this.groupController.getGroupProfile({
                    groupID: t
                }).then(function(e) {
                    var t = e.data.group;
                    t && (n.groupController.updateGroupMap([ t ]), n.groupController.emitGroupListUpdate());
                }), this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 2
                });
            }
        }, {
            key: "_onApplyGroupRequestRefused",
            value: function(e) {
                this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 3
                });
            }
        }, {
            key: "_onMemberKicked",
            value: function(e) {
                var t = e.payload.groupProfile.groupID;
                this.groupController.hasLocalGroup(t) && this.groupController.deleteLocalGroupAndConversation(t), 
                this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 4
                });
            }
        }, {
            key: "_onGroupDismissed",
            value: function(e) {
                var t = e.payload.groupProfile.groupID, n = this.groupController.hasLocalGroup(t), r = this.groupController.AVChatRoomHandler;
                n && this.groupController.deleteLocalGroupAndConversation(t), r.checkJoinedAVChatRoomByID(t) && r.reset(), 
                this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 5
                });
            }
        }, {
            key: "_onInviteGroup",
            value: function(e) {
                var n = this, t = e.payload.groupProfile.groupID;
                this.groupController.hasLocalGroup(t) || this.groupController.getGroupProfile({
                    groupID: t
                }).then(function(e) {
                    var t = e.data.group;
                    t && (n.groupController.updateGroupMap([ t ]), n.groupController.emitGroupListUpdate());
                }), this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 7
                });
            }
        }, {
            key: "_onQuitGroup",
            value: function(e) {
                var t = e.payload.groupProfile.groupID;
                this.groupController.hasLocalGroup(t) && this.groupController.deleteLocalGroupAndConversation(t), 
                this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 8
                });
            }
        }, {
            key: "_onSetManager",
            value: function(e) {
                var t = e.payload.groupProfile, n = t.to, r = t.groupID, o = this.groupController.getLocalGroupMemberInfo(r, n);
                o && o.updateRole(B.GRP_MBR_ROLE_ADMIN), this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 9
                });
            }
        }, {
            key: "_onDeleteManager",
            value: function(e) {
                var t = e.payload.groupProfile, n = t.to, r = t.groupID, o = this.groupController.getLocalGroupMemberInfo(r, n);
                o && o.updateRole(B.GRP_MBR_ROLE_MEMBER), this.tim.outerEmitter.emit(l.GROUP_SYSTEM_NOTICE_RECEIVED, {
                    message: e,
                    type: 10
                });
            }
        }, {
            key: "reset",
            value: function() {
                this.pendencyMap.clear();
            }
        } ]), t;
    }(), Aa = {
        3: 1,
        4: 1,
        5: 1,
        6: 1
    }, wa = function() {
        function r(e) {
            var t = e.tim, n = e.groupController;
            a(this, r), this.tim = t, this.groupController = n, this.AVChatRoomLoop = null, 
            this.key = "", this.startSeq = 0, this.group = {};
        }
        return i(r, [ {
            key: "hasJoinedAVChatRoom",
            value: function() {
                return this.group && !te(this.group.groupID) ? 1 : 0;
            }
        }, {
            key: "checkJoinedAVChatRoomByID",
            value: function(e) {
                return this.group || !te(this.group.groupID) ? e === this.group.groupID : 0;
            }
        }, {
            key: "getJoinedAVChatRoom",
            value: function() {
                return this.hasJoinedAVChatRoom() ? this.group : null;
            }
        }, {
            key: "_updateProperties",
            value: function(t) {
                var n = this;
                Object.keys(t).forEach(function(e) {
                    n[e] = t[e];
                });
            }
        }, {
            key: "start",
            value: function() {
                var e = {
                    key: this.key,
                    startSeq: this.startSeq
                };
                if (null === this.AVChatRoomLoop) {
                    var t = this.tim.notificationController.createPackage({
                        name: "AVChatRoom",
                        action: "startLongPoll",
                        param: e
                    });
                    this.AVChatRoomLoop = this.tim.connectionController.createRunLoop({
                        pack: t,
                        before: this._updateRequestData.bind(this),
                        success: this._handleSuccess.bind(this),
                        fail: this._handleFailure.bind(this)
                    }), this.AVChatRoomLoop.start(), $.log("AVChatRoomHandler.start message channel started");
                } else this.AVChatRoomLoop.isRunning() || this.AVChatRoomLoop.start();
            }
        }, {
            key: "stop",
            value: function() {
                null !== this.AVChatRoomLoop && this.AVChatRoomLoop.isRunning() && (this.AVChatRoomLoop.abort(), 
                this.AVChatRoomLoop.stop(), $.log("AVChatRoomHandler.stop message channel stopped"));
            }
        }, {
            key: "startRunLoop",
            value: function(n) {
                var r = this;
                return this._precheck().then(function() {
                    var e = n.longPollingKey, t = n.group;
                    return r._updateProperties({
                        key: e,
                        startSeq: 0,
                        group: t || {}
                    }), r.groupController.updateGroupMap([ t ]), r.groupController.emitGroupListUpdate(1, 0), 
                    r.start(), r.groupController.isLoggedIn() ? oo({
                        status: Fr.SUCCESS,
                        group: t
                    }) : oo({
                        status: Fr.SUCCESS
                    });
                });
            }
        }, {
            key: "joinWithoutAuth",
            value: function(r) {
                var o = this, e = this.groupController.createPackage({
                    name: "group",
                    action: "applyJoinAVChatRoom",
                    param: r
                });
                return this.tim.connectionController.request(e).then(function(e) {
                    var t = e.data.longPollingKey;
                    $.log("AVChatRoomHandler.joinWithoutAuth ok. groupID:", r.groupID), o.tim.innerEmitter.emit(Or, {
                        data: r.groupID
                    });
                    var n = new ga({
                        groupID: r.groupID
                    });
                    return o.startRunLoop({
                        group: n,
                        longPollingKey: t
                    }), new no({
                        status: Fr.SUCCESS
                    });
                }).catch(function(e) {
                    return $.error("AVChatRoomHandler.joinWithoutAuth error:".concat(e.message, ". groupID:").concat(r.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "_precheck",
            value: function() {
                if (!this.hasJoinedAVChatRoom()) return Promise.resolve();
                if (this.groupController.isLoggedIn()) {
                    if (this.group.selfInfo.role !== B.GRP_MBR_ROLE_OWNER && this.group.ownerID !== this.tim.loginInfo.identifier) return this.groupController.quitGroup(this.group.groupID);
                    this.groupController.deleteLocalGroupAndConversation(this.group.groupID);
                } else this.groupController.deleteLocalGroupAndConversation(this.group.groupID);
                return this.reset(), Promise.resolve();
            }
        }, {
            key: "_updateRequestData",
            value: function(e) {
                e.StartSeq = this.startSeq, e.Key = this.key, this.tim.sumStatController.addTotalCount(co);
            }
        }, {
            key: "_handleSuccess",
            value: function(e) {
                this.tim.sumStatController.addSuccessCount(co), this.tim.sumStatController.addCost(co, e.data.timecost), 
                this.startSeq = e.data.nextSeq, this.key = e.data.key, Array.isArray(e.data.rspMsgList) && e.data.rspMsgList.forEach(function(e) {
                    e.to = e.groupID;
                }), e.data.rspMsgList && 0 < e.data.rspMsgList.length && this._dispatchNotice(e.data.rspMsgList);
            }
        }, {
            key: "_handleFailure",
            value: function(n) {
                if (n.error) {
                    var r = new go();
                    r.setMethod(Ao).setStart(), this.groupController.probeNetwork(function(e, t) {
                        r.setError(n.error, e, t).setEnd();
                    }), this.tim.innerEmitter.emit(Ar, n.error);
                }
            }
        }, {
            key: "_dispatchNotice",
            value: function(e) {
                if (ee(e) && 0 !== e.length) {
                    for (var t = null, n = [], r = [], o = 0; o < e.length; o++) Aa[e[o].event] ? (t = this.packMessage(e[o], e[o].event)).conversationType !== B.CONV_SYSTEM ? this.tim.messageController.hasLocalMessage(t.conversationID, t.ID) || n.push(t) : r.push(t) : $.warn("AVChatRoomHandler._dispatchMessage 未处理的 event 类型：", e[o].event);
                    if (0 < r.length && this.tim.innerEmitter.emit(or, {
                        data: {
                            result: r,
                            eventDataList: [],
                            type: "poll"
                        }
                    }), 0 !== n.length) {
                        var i = this.packConversationOption(n);
                        0 < i.length && this.tim.innerEmitter.emit(rr, {
                            data: {
                                eventDataList: i,
                                type: "poll"
                            }
                        }), this.tim.outerEmitter.emit(l.MESSAGE_RECEIVED, n);
                    }
                }
            }
        }, {
            key: "packMessage",
            value: function(e, t) {
                e.currentUser = this.tim.context.identifier, e.conversationType = 5 === t ? B.CONV_SYSTEM : B.CONV_GROUP, 
                e.isSystemMessage = !!e.isSystemMessage;
                var n = new ha(e), r = this.packElements(e, t);
                return n.setElement(r), n;
            }
        }, {
            key: "packElements",
            value: function(e, t) {
                return 4 === t || 6 === t ? {
                    type: B.MSG_GRP_TIP,
                    content: H({}, e.elements, {
                        groupProfile: e.groupProfile
                    })
                } : 5 === t ? {
                    type: B.MSG_GRP_SYS_NOTICE,
                    content: H({}, e.elements, {
                        groupProfile: e.groupProfile
                    })
                } : this.tim.bigDataHallwayController.parseElements(e.elements, e.from);
            }
        }, {
            key: "packConversationOption",
            value: function(e) {
                for (var t = new Map(), n = 0; n < e.length; n++) {
                    var r = e[n], o = r.conversationID;
                    if (t.has(o)) {
                        var i = t.get(o);
                        "in" === (i.lastMessage = r).flow && i.unreadCount++;
                    } else t.set(o, {
                        conversationID: r.conversationID,
                        unreadCount: "out" === r.flow ? 0 : 1,
                        type: r.conversationType,
                        subType: r.conversationSubType,
                        lastMessage: r
                    });
                }
                return m(t.values());
            }
        }, {
            key: "reset",
            value: function() {
                null !== this.AVChatRoomLoop && ($.log("AVChatRoomHandler.reset"), this.stop(), 
                this.AVChatRoomLoop = null, this.key = "", this.startSeq = 0, this.group = {});
            }
        } ]), r;
    }(), La = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).groupMap = new Map(), t.groupMemberListMap = new Map(), 
            t.hasLocalGroupList = 0, t.groupNoticeHandler = new Ea({
                tim: e,
                groupController: f(t)
            }), t.groupTipsHandler = new Ta({
                tim: e,
                groupController: f(t)
            }), t.AVChatRoomHandler = new wa({
                tim: e,
                groupController: f(t)
            }), t._initListeners(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "createGroup",
            value: function(n) {
                var r = this;
                if (![ "Public", "Private", "ChatRoom", "AVChatRoom" ].includes(n.type)) {
                    var e = new qn({
                        code: it,
                        message: hn
                    });
                    return io(e);
                }
                Ce(n.type) && !te(n.memberList) && 0 < n.memberList.length && ($.warn("GroupController.createGroup 创建AVChatRoom时不能添加群成员，自动忽略该字段"), 
                n.memberList = void 0), Ie(n.type) || te(n.joinOption) || ($.warn("GroupController.createGroup 创建Private/ChatRoom/AVChatRoom群时不能设置字段：joinOption，自动忽略该字段"), 
                n.joinOption = void 0);
                var o = new go();
                o.setMethod(ko).setStart();
                var t = this.createPackage({
                    name: "group",
                    action: "create",
                    param: n
                });
                return $.log("GroupController.createGroup."), this.tim.connectionController.request(t).then(function(e) {
                    if (o.setCode(0).setNetworkType(r.getNetworkType()).setText("grpType=".concat(n.type)).setEnd(), 
                    $.log("GroupController.createGroup ok. groupID:", e.data.groupID), n.type === B.GRP_AVCHATROOM) return r.getGroupProfile({
                        groupID: e.data.groupID
                    });
                    r.updateGroupMap([ H({}, n, {
                        groupID: e.data.groupID
                    }) ]);
                    var t = r.tim.createCustomMessage({
                        to: e.data.groupID,
                        conversationType: B.CONV_GROUP,
                        payload: {
                            data: "group_create",
                            extension: "".concat(r.tim.context.identifier, "创建群组")
                        }
                    });
                    return r.tim.sendMessage(t), r.emitGroupListUpdate(), r.getGroupProfile({
                        groupID: e.data.groupID
                    });
                }).then(function(e) {
                    var t = e.data.group;
                    return t.selfInfo.messageRemindType = B.MSG_REMIND_ACPT_AND_NOTE, t.selfInfo.role = B.GRP_MBR_ROLE_OWNER, 
                    e;
                }).catch(function(n) {
                    return r.probeNetwork().then(function(e, t) {
                        o.setError(n, e, t).setEnd();
                    }), $.error("GroupController.createGroup error:", n), io(n);
                });
            }
        }, {
            key: "joinGroup",
            value: function(e) {
                if (this.hasLocalGroup(e.groupID)) {
                    var t = {
                        status: B.JOIN_STATUS_ALREADY_IN_GROUP
                    };
                    return oo(t);
                }
                if (e.type === B.GRP_PRIVATE) {
                    var n = new qn({
                        code: st,
                        message: fn
                    });
                    return this.tim.innerEmitter.emit(Ar, n), io(n);
                }
                return $.log("GroupController.joinGroup. groupID:", e.groupID), this.isLoggedIn() ? this.applyJoinGroup(e) : this.AVChatRoomHandler.joinWithoutAuth(e);
            }
        }, {
            key: "quitGroup",
            value: function(t) {
                var e = this;
                $.log("GroupController.quitGroup. groupID:", t);
                var n = this.AVChatRoomHandler.checkJoinedAVChatRoomByID(t);
                if (n && !this.isLoggedIn()) return $.log("GroupController.quitGroup anonymously ok. groupID:", t), 
                this.deleteLocalGroupAndConversation(t), this.AVChatRoomHandler.reset(), oo({
                    groupID: t
                });
                var r = this.createPackage({
                    name: "group",
                    action: "quitGroup",
                    param: {
                        groupID: t
                    }
                });
                return this.tim.connectionController.request(r).then(function() {
                    return $.log("GroupController.quitGroup ok. groupID:", t), n && e.AVChatRoomHandler.reset(), 
                    e.deleteLocalGroupAndConversation(t), new no({
                        groupID: t
                    });
                }).catch(function(e) {
                    return $.error("GroupController.quitGroup error.  error:".concat(e, ". groupID:").concat(t)), 
                    io(e);
                });
            }
        }, {
            key: "changeGroupOwner",
            value: function(i) {
                var s = this;
                if (this.hasLocalGroup(i.groupID) && this.getLocalGroupProfile(i.groupID).type === B.GRP_AVCHATROOM) return io(new qn({
                    code: at,
                    message: gn
                }));
                if (i.newOwnerID === this.tim.loginInfo.identifier) return io(new qn({
                    code: ut,
                    message: dn
                }));
                var e = this.createPackage({
                    name: "group",
                    action: "changeGroupOwner",
                    param: i
                });
                return $.log("GroupController.changeGroupOwner. groupID:", i.groupID), this.tim.connectionController.request(e).then(function() {
                    $.log("GroupController.changeGroupOwner ok. groupID:", i.groupID);
                    var e = i.groupID, t = i.newOwnerID;
                    s.groupMap.get(e).ownerID = t;
                    var n = s.groupMemberListMap.get(e);
                    if (n instanceof Map) {
                        var r = n.get(s.tim.loginInfo.identifier);
                        te(r) || (r.updateRole("Member"), s.groupMap.get(e).selfInfo.role = "Member");
                        var o = n.get(t);
                        te(o) || o.updateRole("Owner");
                    }
                    return s.emitGroupListUpdate(1, 0), new no({
                        group: s.groupMap.get(e)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.changeGroupOwner error:".concat(e, ". groupID:").concat(i.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "dismissGroup",
            value: function(t) {
                var e = this;
                if (this.hasLocalGroup(t) && this.getLocalGroupProfile(t).type === B.GRP_PRIVATE) return io(new qn({
                    code: ct,
                    message: mn
                }));
                var n = this.createPackage({
                    name: "group",
                    action: "destroyGroup",
                    param: {
                        groupID: t
                    }
                });
                return $.log("GroupController.dismissGroup. groupID:".concat(t)), this.tim.connectionController.request(n).then(function() {
                    return $.log("GroupController.dismissGroup ok. groupID:".concat(t)), e.deleteLocalGroupAndConversation(t), 
                    e.checkJoinedAVChatRoomByID(t) && e.AVChatRoomHandler.reset(), new no({
                        groupID: t
                    });
                }).catch(function(e) {
                    return $.error("GroupController.dismissGroup error:".concat(e, ". groupID:").concat(t)), 
                    io(e);
                });
            }
        }, {
            key: "updateGroupProfile",
            value: function(t) {
                var e = this;
                !this.hasLocalGroup(t.groupID) || Ie(this.getLocalGroupProfile(t.groupID).type) || te(t.joinOption) || ($.warn("GroupController.modifyGroup: Private/ChatRoom/AVChatRoom群不能设置字段：joinOption，自动忽略该字段"), 
                t.joinOption = void 0);
                var n = this.createPackage({
                    name: "group",
                    action: "updateGroupProfile",
                    param: t
                });
                return $.log("GroupController.modifyGroup. groupID:", t.groupID), this.tim.connectionController.request(n).then(function() {
                    return $.log("GroupController.modifyGroup ok. groupID:", t.groupID), e.hasLocalGroup(t.groupID) && (e.groupMap.get(t.groupID).updateGroup(t), 
                    e._setLocalGroupList(e.groupMap)), new no({
                        group: e.groupMap.get(t.groupID)
                    });
                }).catch(function(e) {
                    return $.log("GroupController.modifyGroup error. error:".concat(e, " groupID:").concat(t.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "setGroupMemberRole",
            value: function(t) {
                var n = this, e = this.groupMap.get(t.groupID);
                if (e.selfInfo.role !== B.GRP_MBR_ROLE_OWNER) return io(new qn({
                    code: ft,
                    message: In
                }));
                if ([ B.GRP_PRIVATE, B.GRP_AVCHATROOM ].includes(e.type)) return io(new qn({
                    code: gt,
                    message: Cn
                }));
                if ([ B.GRP_MBR_ROLE_ADMIN, B.GRP_MBR_ROLE_MEMBER ].indexOf(t.role) < 0) return io(new qn({
                    code: dt,
                    message: Mn
                }));
                if (t.userID === this.tim.loginInfo.identifier) return io(new qn({
                    code: mt,
                    message: Dn
                }));
                $.log("GroupController.setGroupMemberRole. groupID:".concat(t.groupID, ". userID: ").concat(t.userID));
                var r = t.groupID, o = t.userID, i = t.role;
                return this._modifyGroupMemberInfo({
                    groupID: r,
                    userID: o,
                    role: i
                }).then(function() {
                    $.log("GroupController.setGroupMemberRole ok. groupID:".concat(t.groupID, ". userID: ").concat(t.userID));
                    var e = n.groupMemberListMap.get(t.groupID);
                    return void 0 !== e && void 0 !== e.get(t.userID) && e.get(t.userID).updateRole(t.role), 
                    new no({
                        group: n.groupMap.get(t.groupID)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.setGroupMemberRole error:".concat(e, ". groupID:").concat(t.groupID, ". userID:").concat(t.userID)), 
                    io(e);
                });
            }
        }, {
            key: "setGroupMemberMuteTime",
            value: function(t) {
                var e = this;
                $.log("GroupController.setGroupMemberMuteTime. groupID:".concat(t.groupID, ". userID: ").concat(t.userID));
                var n = t.groupID, r = t.userID, o = t.muteTime;
                return this._modifyGroupMemberInfo({
                    groupID: n,
                    userID: r,
                    muteTime: o
                }).then(function() {
                    return $.log("GroupController.setGroupMemberMuteTime ok. groupID:".concat(t.groupID, ". userID: ").concat(t.userID)), 
                    new no({
                        group: e.getLocalGroupProfile(n)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.setGroupMemberMuteTime error:".concat(e, ". groupID:").concat(t.groupID, ". userID:").concat(t.userID)), 
                    io(e);
                });
            }
        }, {
            key: "setMessageRemindType",
            value: function(t) {
                var n = this;
                $.log("GroupController.setMessageRemindType. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || this.tim.loginInfo.identifier));
                var e = t.groupID, r = t.messageRemindType;
                return this._modifyGroupMemberInfo({
                    groupID: e,
                    messageRemindType: r,
                    userID: this.tim.loginInfo.identifier
                }).then(function() {
                    $.log("GroupController.setMessageRemindType ok. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || n.tim.loginInfo.identifier));
                    var e = n.getLocalGroupProfile(t.groupID);
                    return e && (e.selfInfo.messageRemindType = r), new no({
                        group: e
                    });
                }).catch(function(e) {
                    return $.error("GroupController.setMessageRemindType error:".concat(e, ". groupID:").concat(t.groupID, ". userID:").concat(t.userID || n.tim.loginInfo.identifier)), 
                    io(e);
                });
            }
        }, {
            key: "setGroupMemberNameCard",
            value: function(t) {
                var n = this;
                $.log("GroupController.setGroupMemberNameCard. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || this.tim.loginInfo.identifier));
                var r = t.groupID, e = t.userID, o = void 0 === e ? this.tim.loginInfo.identifier : e, i = t.nameCard;
                return this._modifyGroupMemberInfo({
                    groupID: r,
                    userID: o,
                    nameCard: i
                }).then(function() {
                    $.log("GroupController.setGroupMemberNameCard ok. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || n.tim.loginInfo.identifier));
                    var e = n.groupMemberListMap.get(r);
                    return void 0 !== e && void 0 !== e.get(o) && e.get(o).updateMember({
                        nameCard: i
                    }), o === n.tim.loginInfo.identifier && n.hasLocalGroup(r) && (n.getLocalGroupProfile(r).selfInfo.nameCard = i), 
                    new no({
                        group: n.groupMap.get(r)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.setGroupMemberNameCard error:".concat(e, ". groupID:").concat(t.groupID, ". userID:").concat(t.userID || n.tim.loginInfo.identifier)), 
                    io(e);
                });
            }
        }, {
            key: "setGroupMemberCustomField",
            value: function(t) {
                var n = this;
                $.log("GroupController.setGroupMemberCustomField. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || this.tim.loginInfo.identifier));
                var e = t.groupID, r = t.userID, o = t.memberCustomField;
                return this._modifyGroupMemberInfo({
                    groupID: e,
                    userID: r || this.tim.loginInfo.identifier,
                    memberCustomField: o
                }).then(function() {
                    return $.log("GroupController.setGroupMemberCustomField ok. groupID:".concat(t.groupID, ". userID: ").concat(t.userID || n.tim.loginInfo.identifier)), 
                    n.groupMemberListMap.has(e) && n.groupMemberListMap.get(e).has(r) && n.groupMemberListMap.get(e).get(r).updateMemberCustomField(o), 
                    new no({
                        group: n.groupMap.get(e)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.setGroupMemberCustomField error:".concat(e, ". groupID:").concat(t.groupID, ". userID:").concat(t.userID || n.tim.loginInfo.identifier)), 
                    io(e);
                });
            }
        }, {
            key: "getGroupList",
            value: function(e) {
                var r = this, o = new go();
                o.setMethod(To).setStart(), $.log("GroupController.getGroupList");
                var t = {
                    introduction: "Introduction",
                    notification: "Notification",
                    createTime: "CreateTime",
                    ownerID: "Owner_Account",
                    lastInfoTime: "LastInfoTime",
                    memberNum: "MemberNum",
                    maxMemberNum: "MaxMemberNum",
                    joinOption: "ApplyJoinOption"
                }, n = [ "Type", "Name", "FaceUrl", "NextMsgSeq", "LastMsgTime" ];
                e && e.groupProfileFilter && e.groupProfileFilter.forEach(function(e) {
                    t[e] && n.push(t[e]);
                });
                var i = this.createPackage({
                    name: "group",
                    action: "list",
                    param: {
                        responseFilter: {
                            groupBaseInfoFilter: n,
                            selfInfoFilter: [ "Role", "JoinTime", "MsgFlag" ]
                        }
                    }
                });
                return this.tim.connectionController.request(i).then(function(e) {
                    var t = e.data.groups;
                    return o.setCode(0).setNetworkType(r.getNetworkType()).setText(t.length).setEnd(), 
                    $.log("GroupController.getGroupList ok"), r._groupListTreeShaking(t), r.updateGroupMap(t), 
                    r.hasLocalGroupList = 1, r.tempConversationList && (r._handleUpdateGroupLastMessage(r.tempConversationList), 
                    r.tempConversationList = null), r.emitGroupListUpdate(), new no({
                        groupList: r.getLocalGroups()
                    });
                }).catch(function(n) {
                    return r.probeNetwork().then(function(e, t) {
                        o.setError(n, e, t).setEnd();
                    }), $.error("GroupController.getGroupList error: ", n), io(n);
                });
            }
        }, {
            key: "getGroupMemberList",
            value: function(e) {
                var o = this, i = e.groupID, t = e.offset, n = void 0 === t ? 0 : t, r = e.count, s = void 0 === r ? 15 : r;
                $.log("GroupController.getGroupMemberList groupID: ".concat(i, " offset: ").concat(n, " count: ").concat(s));
                var a = this.createPackage({
                    name: "group",
                    action: "getGroupMemberList",
                    param: {
                        groupID: i,
                        offset: n,
                        limit: 100 < s ? 100 : s,
                        memberInfoFilter: [ "Role", "NameCard" ]
                    }
                }), u = [];
                return this.connectionController.request(a).then(function(e) {
                    var t = e.data, n = t.members, r = t.memberNum;
                    return ee(n) && 0 !== n.length ? (o.hasLocalGroup(i) && (o.getLocalGroupProfile(i).memberNum = r), 
                    u = o._updateLocalGroupMemberMap(i, n), o.tim.getUserProfile({
                        userIDList: n.map(function(e) {
                            return e.userID;
                        }),
                        tagList: [ Qr.NICK, Qr.AVATAR ]
                    })) : Promise.resolve([]);
                }).then(function(e) {
                    var t = e.data;
                    if (!ee(t) || 0 === t.length) return oo({
                        memberList: []
                    });
                    var n = t.map(function(e) {
                        return {
                            userID: e.userID,
                            nick: e.nick,
                            avatar: e.avatar
                        };
                    });
                    return o._updateLocalGroupMemberMap(i, n), $.log("GroupController.getGroupMemberList ok."), 
                    new no({
                        memberList: u
                    });
                }).catch(function(e) {
                    return $.error("GroupController.getGroupMemberList error: ", e), io(e);
                });
            }
        }, {
            key: "getLocalGroups",
            value: function() {
                return m(this.groupMap.values());
            }
        }, {
            key: "getLocalGroupProfile",
            value: function(e) {
                return this.groupMap.get(e);
            }
        }, {
            key: "hasLocalGroup",
            value: function(e) {
                return this.groupMap.has(e);
            }
        }, {
            key: "getLocalGroupMemberInfo",
            value: function(e, t) {
                return this.groupMemberListMap.has(e) ? this.groupMemberListMap.get(e).get(t) : null;
            }
        }, {
            key: "setLocalGroupMember",
            value: function(e, t) {
                if (this.groupMemberListMap.has(e)) this.groupMemberListMap.get(e).set(t.userID, t); else {
                    var n = new Map().set(t.userID, t);
                    this.groupMemberListMap.set(e, n);
                }
            }
        }, {
            key: "hasLocalGroupMember",
            value: function(e, t) {
                return this.groupMemberListMap.has(e) && this.groupMemberListMap.get(e).has(t);
            }
        }, {
            key: "hasLocalGroupMemberMap",
            value: function(e) {
                return this.groupMemberListMap.has(e);
            }
        }, {
            key: "getGroupProfile",
            value: function(i) {
                var s = this;
                $.log("GroupController.getGroupProfile. groupID:", i.groupID);
                var a = i.groupID, e = i.groupCustomFieldFilter, t = i.memberCustomFieldFilter, n = {
                    groupIDList: [ a ],
                    responseFilter: {
                        groupBaseInfoFilter: [ "Type", "Name", "Introduction", "Notification", "FaceUrl", "Owner_Account", "CreateTime", "InfoSeq", "LastInfoTime", "LastMsgTime", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "NextMsgSeq" ],
                        groupCustomFieldFilter: e,
                        memberCustomFieldFilter: t
                    }
                };
                return this.getGroupProfileAdvance(n).then(function(e) {
                    var t, n = e.data, r = n.successGroupList, o = n.failureGroupList;
                    return $.log("GroupController.getGroupProfile ok. groupID:", i.groupID), 0 < o.length ? io(o[0]) : (Ce(r[0].type) && !s.hasLocalGroup(a) ? t = new ga(r[0]) : (s.updateGroupMap(r), 
                    t = s.getLocalGroupProfile(a)), t && t.selfInfo && !t.selfInfo.nameCard ? s.updateSelfInfo(t).then(function(e) {
                        return new no({
                            group: e
                        });
                    }) : new no({
                        group: t
                    }));
                }).catch(function(e) {
                    return $.error("GroupController.getGroupProfile error:".concat(e, ". groupID:").concat(i.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "getGroupMemberProfile",
            value: function(e) {
                var r = this;
                $.log("GroupController.getGroupMemberProfile groupID:".concat(e.groupID, "\n     userIDList:").concat(e.userIDList.join(","))), 
                50 < e.userIDList.length && (e.userIDList = e.userIDList.slice(0, 50));
                var o = e.groupID, i = e.userIDList;
                return this._getGroupMemberProfileAdvance(H({}, e, {
                    userIDList: i
                })).then(function(e) {
                    var t = e.data.members;
                    return ee(t) && 0 !== t.length ? (r._updateLocalGroupMemberMap(o, t), r.tim.getUserProfile({
                        userIDList: t.map(function(e) {
                            return e.userID;
                        }),
                        tagList: [ Qr.NICK, Qr.AVATAR ]
                    })) : oo([]);
                }).then(function(e) {
                    var t = e.data.map(function(e) {
                        return {
                            userID: e.userID,
                            nick: e.nick,
                            avatar: e.avatar
                        };
                    });
                    r._updateLocalGroupMemberMap(o, t);
                    var n = i.filter(function(e) {
                        return r.hasLocalGroupMember(o, e);
                    }).map(function(e) {
                        return r.getLocalGroupMemberInfo(o, e);
                    });
                    return new no({
                        memberList: n
                    });
                });
            }
        }, {
            key: "_getGroupMemberProfileAdvance",
            value: function(e) {
                var t = this.createPackage({
                    name: "group",
                    action: "getGroupMemberProfile",
                    param: H({}, e, {
                        memberInfoFilter: e.memberInfoFilter ? e.memberInfoFilter : [ "Role", "JoinTime", "NameCard", "ShutUpUntil" ]
                    })
                });
                return this.connectionController.request(t);
            }
        }, {
            key: "updateSelfInfo",
            value: function(n) {
                var r = n.groupID;
                $.log("GroupController.updateSelfInfo groupID:", r);
                var e = {
                    groupID: r,
                    userIDList: [ this.tim.loginInfo.identifier ]
                };
                return this.getGroupMemberProfile(e).then(function(e) {
                    var t = e.data.memberList;
                    return $.log("GroupController.updateSelfInfo ok. groupID:", r), n && 0 !== t.length && n.updateSelfInfo(t[0]), 
                    n;
                });
            }
        }, {
            key: "addGroupMember",
            value: function(i) {
                var s = this.getLocalGroupProfile(i.groupID);
                if (Ce(s.type)) {
                    var e = new qn({
                        code: pt,
                        message: vn
                    });
                    return io(e);
                }
                i.userIDList = i.userIDList.map(function(e) {
                    return {
                        userID: e
                    };
                });
                var t = this.createPackage({
                    name: "group",
                    action: "addGroupMember",
                    param: i
                });
                return $.log("GroupController.addGroupMember. groupID:", i.groupID), this.connectionController.request(t).then(function(e) {
                    var t = e.data.members;
                    $.log("GroupController.addGroupMember ok. groupID:", i.groupID);
                    var n = t.filter(function(e) {
                        return 1 === e.result;
                    }).map(function(e) {
                        return e.userID;
                    }), r = t.filter(function(e) {
                        return 0 === e.result;
                    }).map(function(e) {
                        return e.userID;
                    }), o = t.filter(function(e) {
                        return 2 === e.result;
                    }).map(function(e) {
                        return e.userID;
                    });
                    return 0 === n.length ? new no({
                        successUserIDList: n,
                        failureUserIDList: r,
                        existedUserIDList: o
                    }) : (s.memberNum += n.length, new no({
                        successUserIDList: n,
                        failureUserIDList: r,
                        existedUserIDList: o,
                        group: s
                    }));
                }).catch(function(e) {
                    return $.error("GroupController.addGroupMember error:".concat(e, ", groupID:").concat(i.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "deleteGroupMember",
            value: function(t) {
                var e = this;
                $.log("GroupController.deleteGroupMember groupID:".concat(t.groupID, " userIDList:").concat(t.userIDList));
                var n = this.getLocalGroupProfile(t.groupID);
                if (n.type === B.GRP_AVCHATROOM) return io(new qn({
                    code: ht,
                    message: _n
                }));
                var r = this.createPackage({
                    name: "group",
                    action: "deleteGroupMember",
                    param: t
                });
                return this.connectionController.request(r).then(function() {
                    return $.log("GroupController.deleteGroupMember ok"), n.memberNum--, e.deleteLocalGroupMembers(t.groupID, t.userIDList), 
                    new no({
                        group: n,
                        userIDList: t.userIDList
                    });
                }).catch(function(e) {
                    return $.error("GroupController.deleteGroupMember error:".concat(e.code, ", groupID:").concat(t.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "searchGroupByID",
            value: function(n) {
                var e = {
                    groupIDList: [ n ]
                }, t = this.createPackage({
                    name: "group",
                    action: "searchGroupByID",
                    param: e
                });
                return $.log("GroupController.searchGroupByID. groupID:".concat(n)), this.connectionController.request(t).then(function(e) {
                    var t = e.data.groupProfile;
                    if ($.log("GroupController.searchGroupByID ok. groupID:".concat(n)), t[0].errorCode !== Br.SUCCESS) throw new qn({
                        code: t[0].errorCode,
                        message: t[0].errorInfo
                    });
                    return new no({
                        group: new ga(t[0])
                    });
                }).catch(function(e) {
                    return $.error("GroupController.searchGroupByID error:".concat(e, ", groupID:").concat(n)), 
                    io(e);
                });
            }
        }, {
            key: "applyJoinGroup",
            value: function(i) {
                var s = this, e = this.createPackage({
                    name: "group",
                    action: "applyJoinGroup",
                    param: i
                });
                return this.connectionController.request(e).then(function(e) {
                    var t = e.data, n = t.joinedStatus, r = t.longPollingKey;
                    switch ($.log("GroupController.joinGroup ok. groupID:", i.groupID), n) {
                      case Fr.WAIT_APPROVAL:
                        return new no({
                            status: Fr.WAIT_APPROVAL
                        });

                      case Fr.SUCCESS:
                        return s.getGroupProfile({
                            groupID: i.groupID
                        }).then(function(e) {
                            var t = e.data.group, n = {
                                status: Fr.SUCCESS,
                                group: t
                            };
                            return te(r) ? new no(n) : (s.tim.innerEmitter.emit(Or, {
                                data: i.groupID
                            }), s.AVChatRoomHandler.startRunLoop({
                                longPollingKey: r,
                                group: t
                            }));
                        });

                      default:
                        var o = new qn({
                            code: lt,
                            message: yn
                        });
                        return $.error("GroupController.joinGroup error:".concat(o, ". groupID:").concat(i.groupID)), 
                        io(o);
                    }
                }).catch(function(e) {
                    return $.error("GroupController.joinGroup error:".concat(e, ". groupID:").concat(i.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "applyJoinAVChatRoom",
            value: function(e) {
                return this.AVChatRoomHandler.applyJoinAVChatRoom(e);
            }
        }, {
            key: "handleGroupApplication",
            value: function(e) {
                var t = this, n = e.message.payload, r = n.groupProfile.groupID, o = n.authentication, i = n.messageKey, s = n.operatorID, a = this.createPackage({
                    name: "group",
                    action: "handleApplyJoinGroup",
                    param: H({}, e, {
                        applicant: s,
                        groupID: r,
                        authentication: o,
                        messageKey: i
                    })
                });
                return $.log("GroupController.handleApplication. groupID:", r), this.connectionController.request(a).then(function() {
                    return $.log("GroupController.handleApplication ok. groupID:", r), t.deleteGroupSystemNotice({
                        messageList: [ e.message ]
                    }), new no({
                        group: t.getLocalGroupProfile(r)
                    });
                }).catch(function(e) {
                    return $.error("GroupController.handleApplication error.  error:".concat(e, ". groupID:").concat(r)), 
                    io(e);
                });
            }
        }, {
            key: "deleteGroupSystemNotice",
            value: function(e) {
                var t = this;
                if (!ee(e.messageList) || 0 === e.messageList.length) return oo();
                $.log("GroupController.deleteGroupSystemNotice " + e.messageList.map(function(e) {
                    return e.ID;
                }));
                var n = this.createPackage({
                    name: "group",
                    action: "deleteGroupSystemNotice",
                    param: {
                        messageListToDelete: e.messageList.map(function(e) {
                            return {
                                from: B.CONV_SYSTEM,
                                messageSeq: e.clientSequence,
                                messageRandom: e.random
                            };
                        })
                    }
                });
                return this.connectionController.request(n).then(function() {
                    return $.log("GroupController.deleteGroupSystemNotice ok"), e.messageList.forEach(function(e) {
                        t.tim.messageController.deleteLocalMessage(e);
                    }), new no();
                }).catch(function(e) {
                    return $.error("GroupController.deleteGroupSystemNotice error:", e), io(e);
                });
            }
        }, {
            key: "getLocalGroupLastSequence",
            value: function(e) {
                if (!this.groupMap.has(e)) return 0;
                var t = this.groupMap.get(e);
                return t.lastMessage.lastSequence ? t.lastMessage.lastSequence : t.nextMessageSeq - 1;
            }
        }, {
            key: "getGroupProfileAdvance",
            value: function(t) {
                ee(t.groupIDList) && 50 < t.groupIDList.length && ($.warn("GroupController.getGroupProfileAdvance 获取群资料的数量不能超过50个"), 
                t.groupIDList.length = 50), $.log("GroupController.getGroupProfileAdvance. groupIDList:", t.groupIDList);
                var e = this.createPackage({
                    name: "group",
                    action: "query",
                    param: t
                });
                return this.tim.connectionController.request(e).then(function(e) {
                    $.log("GroupController.getGroupProfileAdvance ok.");
                    var t = e.data.groups, n = t.filter(function(e) {
                        return te(e.errorCode) || e.errorCode === Br.SUCCESS;
                    }), r = t.filter(function(e) {
                        return e.errorCode && e.errorCode !== Br.SUCCESS;
                    }).map(function(e) {
                        return new qn({
                            code: Number("500".concat(e.errorCode)),
                            message: e.errorInfo,
                            data: {
                                groupID: e.groupID
                            }
                        });
                    });
                    return new no({
                        successGroupList: n,
                        failureGroupList: r
                    });
                }).catch(function(e) {
                    return $.error("GroupController.getGroupProfile error:".concat(e, ". groupID:").concat(t.groupID)), 
                    io(e);
                });
            }
        }, {
            key: "_deleteLocalGroup",
            value: function(e) {
                return this.groupMap.delete(e), this.groupMemberListMap.delete(e), this._setLocalGroupList(this.groupMap), 
                this.groupMap.has(e) && this.groupMemberListMap.has(e);
            }
        }, {
            key: "_initGroupList",
            value: function() {
                var t = this, e = new go();
                e.setMethod(Eo).setStart(), $.time(ho), $.log("GroupController._initGroupList");
                var n = this._getLocalGroups();
                this.hasLocalGroupList = ee(n) && 0 !== n.length, this.hasLocalGroupList ? (n.forEach(function(e) {
                    t.groupMap.set(e[0], new ga(e[1]));
                }), this.emitGroupListUpdate(1, 0), e.setCode(0).setNetworkType(this.getNetworkType()).setText(this.groupMap.size).setEnd()) : e.setCode(0).setNetworkType(this.getNetworkType()).setText(0).setEnd(), 
                this.triggerReady(), $.log("GroupController._initGroupList ok. initCost=".concat($.timeEnd(ho), "ms")), 
                this.getGroupList();
            }
        }, {
            key: "_initListeners",
            value: function() {
                var e = this.tim.innerEmitter;
                e.once(Yn, this._initGroupList, this), e.on(wr, this._handleUpdateGroupLastMessage, this), 
                e.on(rr, this._handleReceivedGroupMessage, this), e.on(Pr, this._handleProfileUpdated, this);
            }
        }, {
            key: "emitGroupListUpdate",
            value: function() {
                var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 1, t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 1, n = this.getLocalGroups();
                t && this.tim.innerEmitter.emit(Dr, n), e && this.tim.outerEmitter.emit(l.GROUP_LIST_UPDATED, n);
            }
        }, {
            key: "_handleReceivedGroupMessage",
            value: function(e) {
                var n = this, t = e.data.eventDataList;
                Array.isArray(t) && t.forEach(function(e) {
                    var t = e.conversationID.replace(B.CONV_GROUP, "");
                    n.groupMap.has(t) && (n.groupMap.get(t).nextMessageSeq = e.lastMessage.sequence + 1);
                });
            }
        }, {
            key: "_onReceivedGroupSystemNotice",
            value: function(e) {
                var t = e.data;
                this.groupNoticeHandler._onReceivedGroupNotice(t);
            }
        }, {
            key: "_handleUpdateGroupLastMessage",
            value: function(e) {
                if (this.hasLocalGroupList) {
                    for (var t = 0, n = 0; n < e.length; n++) {
                        var r = e[n], o = r.type === B.CONV_GROUP;
                        if (r.conversationID && o) {
                            var i = r.conversationID.split(/^GROUP/)[1], s = this.getLocalGroupProfile(i);
                            s && (s.lastMessage = r.lastMessage, t = 1);
                        }
                    }
                    t && (this.groupMap = this._sortLocalGroupList(this.groupMap), this.emitGroupListUpdate(1, 0));
                } else this.tempConversationList = e;
            }
        }, {
            key: "_sortLocalGroupList",
            value: function(e) {
                var t = m(e).filter(function(e) {
                    var t = d(e, 2);
                    return t[0], !ke(t[1].lastMessage);
                });
                return t.sort(function(e, t) {
                    return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime;
                }), new Map([].concat(m(t), m(e)));
            }
        }, {
            key: "_getLocalGroups",
            value: function() {
                return this.tim.storage.getItem("groupMap");
            }
        }, {
            key: "_hasLocalGroupList",
            value: function() {
                var e = this.tim.storage.getItem("groupMap");
                return null !== e && 0 !== e.length;
            }
        }, {
            key: "_setLocalGroupList",
            value: function(e) {
                var t = m(e).slice(0, 100).map(function(e) {
                    var t = d(e, 2), n = t[0], r = t[1];
                    return [ n, {
                        groupID: n,
                        name: r.name,
                        avatar: r.avatar,
                        type: r.type
                    } ];
                });
                this.tim.storage.setItem("groupMap", t);
            }
        }, {
            key: "updateGroupMap",
            value: function(e) {
                var t = this;
                e.forEach(function(e) {
                    t.groupMap.has(e.groupID) ? t.groupMap.get(e.groupID).updateGroup(e) : t.groupMap.set(e.groupID, new ga(e));
                }), this._setLocalGroupList(this.groupMap);
            }
        }, {
            key: "_updateLocalGroupMemberMap",
            value: function(t, e) {
                var n = this;
                return ee(e) && 0 !== e.length ? e.map(function(e) {
                    return n.hasLocalGroupMember(t, e.userID) ? n.getLocalGroupMemberInfo(t, e.userID).updateMember(e) : n.setLocalGroupMember(t, new ka(e)), 
                    n.getLocalGroupMemberInfo(t, e.userID);
                }) : [];
            }
        }, {
            key: "deleteLocalGroupMembers",
            value: function(e, t) {
                var n = this.groupMemberListMap.get(e);
                n && t.forEach(function(e) {
                    n.delete(e);
                });
            }
        }, {
            key: "_modifyGroupMemberInfo",
            value: function(e) {
                var t = this.createPackage({
                    name: "group",
                    action: "modifyGroupMemberInfo",
                    param: e
                });
                return this.tim.connectionController.request(t);
            }
        }, {
            key: "_groupListTreeShaking",
            value: function(e) {
                for (var t = new Map(m(this.groupMap)), n = 0, r = e.length; n < r; n++) t.delete(e[n].groupID);
                this.AVChatRoomHandler.hasJoinedAVChatRoom() && t.delete(this.AVChatRoomHandler.group.groupID);
                for (var o = m(t.keys()), i = 0, s = o.length; i < s; i++) this.groupMap.delete(o[i]);
            }
        }, {
            key: "_handleProfileUpdated",
            value: function(e) {
                for (var n = this, r = e.data, t = function(e) {
                    var t = r[e];
                    n.groupMemberListMap.forEach(function(e) {
                        e.has(t.userID) && e.get(t.userID).updateMember({
                            nick: t.nick,
                            avatar: t.avatar
                        });
                    });
                }, o = 0; o < r.length; o++) t(o);
            }
        }, {
            key: "getJoinedAVChatRoom",
            value: function() {
                return this.AVChatRoomHandler.getJoinedAVChatRoom();
            }
        }, {
            key: "deleteLocalGroupAndConversation",
            value: function(e) {
                this._deleteLocalGroup(e), this.tim.conversationController.deleteLocalConversation("GROUP".concat(e)), 
                this.emitGroupListUpdate(1, 0);
            }
        }, {
            key: "checkJoinedAVChatRoomByID",
            value: function(e) {
                return this.AVChatRoomHandler.checkJoinedAVChatRoomByID(e);
            }
        }, {
            key: "reset",
            value: function() {
                this.groupMap.clear(), this.groupMemberListMap.clear(), this.hasLocalGroupList = 0, 
                this.resetReady(), this.groupNoticeHandler.reset(), this.AVChatRoomHandler.reset(), 
                this.tim.innerEmitter.once(Yn, this._initGroupList, this);
            }
        } ]), n;
    }(), Ra = function() {
        for (var e = [], t = Pa(arguments), n = 0; n < arguments.length; n++) Number.isInteger(arguments[n]) ? e.push(arguments[n]) : e.push(1 == !!arguments[n] ? "1" : "0");
        return e.join(t);
    }, Pa = function(e) {
        var t = e.length, n = e[t - 1];
        if ("string" != typeof n) return "";
        if (1 < n.length) return "";
        var r = e[t - 1];
        return delete e[t - 1], e.length -= t === e.length ? 1 : 0, r;
    }, Oa = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initializeMembers(), t.tim.innerEmitter.on(kr, function() {
                t._initializeStatus(), t._bindListener();
            }), t.tim.innerEmitter.on(Tr, function() {
                t._initializeStatus(), t._unbindListener();
            }), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initializeMembers",
            value: function() {
                this.normalTimeout = 300, this.realtimeNoticeTimeout = 11e4, this.channelMaxTimeout = 3e5;
            }
        }, {
            key: "_initializeStatus",
            value: function() {
                this._initializeAccountStatus(), this._initializeChannelStatus();
            }
        }, {
            key: "_initializeAccountStatus",
            value: function() {
                this.accountStatus = {
                    lastSignInTime: 0,
                    status: Kr.SIGN_OUT
                };
            }
        }, {
            key: "_initializeChannelStatus",
            value: function() {
                this.channelStatus = {
                    startTime: 0,
                    offlineTime: 0,
                    failCount: 0,
                    lastRequestTime: 0,
                    lastJitterTime: 0,
                    jitterCount: 0,
                    jitters: [],
                    status: $r.OFFLINE
                };
            }
        }, {
            key: "getChannelStatus",
            value: function() {
                return this.channelStatus.status;
            }
        }, {
            key: "_channelStatusJittersUpdate",
            value: function(e) {
                this.channelStatus.jitterCount++, this.channelStatus.lastJitterTime = e, this.channelStatus.jitters.push(e), 
                5 < this.channelStatus.jitters.length && this.channelStatus.jitters.pop();
            }
        }, {
            key: "_bindListener",
            value: function() {
                var e = this.tim.innerEmitter;
                e.on(sr, this._onChannelStart, this), e.on(ar, this._onChannelRequestSuccess, this), 
                e.on(ur, this._onChannelFail, this);
            }
        }, {
            key: "_unbindListener",
            value: function() {
                var e = this.tim.innerEmitter;
                e.off(sr, this._onChannelStart, this), e.off(ar, this._onChannelRequestSuccess, this), 
                e.off(ur, this._onChannelFail, this);
            }
        }, {
            key: "_onChannelStart",
            value: function() {
                this.channelStatus.startTime = +new Date(), this.channelStatus.status = $r.ONLINE;
            }
        }, {
            key: "_onChannelRequestSuccess",
            value: function() {
                var e = this.tim.innerEmitter, t = Date.now(), n = t - (0 < this.channelStatus.lastRequestTime ? this.channelStatus.lastRequestTime : Date.now() + 100), r = Ra(n < this.realtimeNoticeTimeout, n < this.channelMaxTimeout);
                switch (this.channelStatus.status = $r.ONLINE, this.channelStatus.failCount = 0, 
                r) {
                  case "11":
                    break;

                  case "01":
                    e.emit(cr);
                    break;

                  case "00":
                    e.emit(lr);
                }
                this.channelStatus.lastRequestTime = t;
            }
        }, {
            key: "_onChannelFail",
            value: function(e) {
                var t = this.tim.innerEmitter, n = Date.now();
                this.channelStatus.status = $r.OFFLINE;
                var r = n - (0 === this.channelStatus.offlineTime ? this.channelStatus.lastRequestTime : this.channelStatus.offlineTime);
                this.channelStatus.offlineTime = n, this.channelStatus.failCount++, $.log("_onChannelFail count : ".concat(this.channelStatus.failCount, "  time diff: ").concat(r, ";")), 
                5 < this.channelStatus.failCount && r < 5e3 && (t.emit(pr), $.error("Detected notice channel offline, please check your network!"));
            }
        } ]), n;
    }();
    function ba() {
        return null;
    }
    var Na = function() {
        function t(e) {
            a(this, t), this.tim = e, this.isWX = E, this.storageQueue = new Map(), this.checkTimes = 0, 
            this.checkTimer = setInterval(this._onCheckTimer.bind(this), 1e3), this._errorTolerantHandle();
        }
        return i(t, [ {
            key: "_errorTolerantHandle",
            value: function() {
                !this.isWX && te(window.localStorage) && (this.getItem = ba, this.setItem = ba, 
                this.removeItem = ba, this.clear = ba);
            }
        }, {
            key: "_onCheckTimer",
            value: function() {
                if (this.checkTimes++, this.checkTimes % 20 == 0) {
                    if (0 === this.storageQueue.size) return;
                    this._doFlush();
                }
            }
        }, {
            key: "_doFlush",
            value: function() {
                try {
                    var e = 1, t = 0, n = void 0;
                    try {
                        for (var r, o = this.storageQueue[Symbol.iterator](); !(e = (r = o.next()).done); e = 1) {
                            var i = d(r.value, 2), s = i[0], a = i[1];
                            this.isWX ? wx.setStorageSync(this._getKey(s), a) : localStorage.setItem(this._getKey(s), JSON.stringify(a));
                        }
                    } catch (e) {
                        t = 1, n = e;
                    } finally {
                        try {
                            e || null == o.return || o.return();
                        } finally {
                            if (t) throw n;
                        }
                    }
                    this.storageQueue.clear();
                } catch (e) {
                    $.warn("Storage._doFlush error", e);
                }
            }
        }, {
            key: "_getPrefix",
            value: function() {
                var e = this.tim.loginInfo, t = e.SDKAppID, n = e.identifier;
                return "TIM_".concat(t, "_").concat(n, "_");
            }
        }, {
            key: "getItem",
            value: function(e) {
                var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 1;
                try {
                    var n = t ? this._getKey(e) : e;
                    return this.isWX ? wx.getStorageSync(n) : JSON.parse(localStorage.getItem(n));
                } catch (e) {
                    $.warn("Storage.getItem error:", e);
                }
            }
        }, {
            key: "setItem",
            value: function(e, t) {
                var n = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 0, r = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : 1;
                if (n) {
                    var o = r ? this._getKey(e) : e;
                    this.isWX ? wx.setStorageSync(o, t) : localStorage.setItem(o, JSON.stringify(t));
                } else this.storageQueue.set(e, t);
            }
        }, {
            key: "clear",
            value: function() {
                try {
                    this.isWX ? wx.clearStorageSync() : localStorage.clear();
                } catch (e) {
                    $.warn("Storage.clear error:", e);
                }
            }
        }, {
            key: "removeItem",
            value: function(e) {
                var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 1;
                try {
                    var n = t ? this._getKey(e) : e;
                    this.isWX ? wx.removeStorageSync(n) : localStorage.removeItem(n);
                } catch (e) {
                    $.warn("Storage.removeItem error:", e);
                }
            }
        }, {
            key: "getSize",
            value: function(e) {
                var t = this, n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "b";
                try {
                    var r = {
                        size: 0,
                        limitSize: 5242880,
                        unit: n
                    };
                    if (Object.defineProperty(r, "leftSize", {
                        enumerable: 1,
                        get: function() {
                            return r.limitSize - r.size;
                        }
                    }), this.isWX && (r.limitSize = 1024 * wx.getStorageInfoSync().limitSize), e) r.size = JSON.stringify(this.getItem(e)).length + this._getKey(e).length; else if (this.isWX) {
                        wx.getStorageInfoSync().keys.forEach(function(e) {
                            r.size += JSON.stringify(wx.getStorageSync(e)).length + t._getKey(e).length;
                        });
                    } else for (var o in localStorage) localStorage.hasOwnProperty(o) && (r.size += localStorage.getItem(o).length + o.length);
                    return this._convertUnit(r);
                } catch (e) {
                    $.warn("Storage.getSize error:", e);
                }
            }
        }, {
            key: "_convertUnit",
            value: function(e) {
                var t = {}, n = e.unit;
                for (var r in t.unit = n, e) "number" == typeof e[r] && ("kb" === n.toLowerCase() ? t[r] = Math.round(e[r] / 1024) : "mb" === n.toLowerCase() ? t[r] = Math.round(e[r] / 1024 / 1024) : t[r] = e[r]);
                return t;
            }
        }, {
            key: "_getKey",
            value: function(e) {
                return "".concat(this._getPrefix()).concat(e);
            }
        }, {
            key: "reset",
            value: function() {
                this._doFlush(), this.checkTimes = 0;
            }
        } ]), t;
    }(), Ga = e(function(e) {
        var r = Object.prototype.hasOwnProperty, f = "~";
        function n() {}
        function a(e, t, n) {
            this.fn = e, this.context = t, this.once = n || 0;
        }
        function o(e, t, n, r, o) {
            if ("function" != typeof n) throw new TypeError("The listener must be a function");
            var i = new a(n, r || e, o), s = f ? f + t : t;
            return e._events[s] ? e._events[s].fn ? e._events[s] = [ e._events[s], i ] : e._events[s].push(i) : (e._events[s] = i, 
            e._eventsCount++), e;
        }
        function c(e, t) {
            0 == --e._eventsCount ? e._events = new n() : delete e._events[t];
        }
        function t() {
            this._events = new n(), this._eventsCount = 0;
        }
        Object.create && (n.prototype = Object.create(null), new n().__proto__ || (f = 0)), 
        t.prototype.eventNames = function() {
            var e, t, n = [];
            if (0 === this._eventsCount) return n;
            for (t in e = this._events) r.call(e, t) && n.push(f ? t.slice(1) : t);
            return Object.getOwnPropertySymbols ? n.concat(Object.getOwnPropertySymbols(e)) : n;
        }, t.prototype.listeners = function(e) {
            var t = f ? f + e : e, n = this._events[t];
            if (!n) return [];
            if (n.fn) return [ n.fn ];
            for (var r = 0, o = n.length, i = new Array(o); r < o; r++) i[r] = n[r].fn;
            return i;
        }, t.prototype.listenerCount = function(e) {
            var t = f ? f + e : e, n = this._events[t];
            return n ? n.fn ? 1 : n.length : 0;
        }, t.prototype.emit = function(e, t, n, r, o, i) {
            var s = f ? f + e : e;
            if (!this._events[s]) return 0;
            var a, u, c = this._events[s], l = arguments.length;
            if (c.fn) {
                switch (c.once && this.removeListener(e, c.fn, void 0, 1), l) {
                  case 1:
                    return c.fn.call(c.context), 1;

                  case 2:
                    return c.fn.call(c.context, t), 1;

                  case 3:
                    return c.fn.call(c.context, t, n), 1;

                  case 4:
                    return c.fn.call(c.context, t, n, r), 1;

                  case 5:
                    return c.fn.call(c.context, t, n, r, o), 1;

                  case 6:
                    return c.fn.call(c.context, t, n, r, o, i), 1;
                }
                for (u = 1, a = new Array(l - 1); u < l; u++) a[u - 1] = arguments[u];
                c.fn.apply(c.context, a);
            } else {
                var p, h = c.length;
                for (u = 0; u < h; u++) switch (c[u].once && this.removeListener(e, c[u].fn, void 0, 1), 
                l) {
                  case 1:
                    c[u].fn.call(c[u].context);
                    break;

                  case 2:
                    c[u].fn.call(c[u].context, t);
                    break;

                  case 3:
                    c[u].fn.call(c[u].context, t, n);
                    break;

                  case 4:
                    c[u].fn.call(c[u].context, t, n, r);
                    break;

                  default:
                    if (!a) for (p = 1, a = new Array(l - 1); p < l; p++) a[p - 1] = arguments[p];
                    c[u].fn.apply(c[u].context, a);
                }
            }
            return 1;
        }, t.prototype.on = function(e, t, n) {
            return o(this, e, t, n, 0);
        }, t.prototype.once = function(e, t, n) {
            return o(this, e, t, n, 1);
        }, t.prototype.removeListener = function(e, t, n, r) {
            var o = f ? f + e : e;
            if (!this._events[o]) return this;
            if (!t) return c(this, o), this;
            var i = this._events[o];
            if (i.fn) i.fn !== t || r && !i.once || n && i.context !== n || c(this, o); else {
                for (var s = 0, a = [], u = i.length; s < u; s++) (i[s].fn !== t || r && !i[s].once || n && i[s].context !== n) && a.push(i[s]);
                a.length ? this._events[o] = 1 === a.length ? a[0] : a : c(this, o);
            }
            return this;
        }, t.prototype.removeAllListeners = function(e) {
            var t;
            return e ? (t = f ? f + e : e, this._events[t] && c(this, t)) : (this._events = new n(), 
            this._eventsCount = 0), this;
        }, t.prototype.off = t.prototype.removeListener, t.prototype.addListener = t.prototype.on, 
        t.prefixed = f, t.EventEmitter = t, e.exports = t;
    }), Ua = function(e) {
        var t, n, r, o, i;
        return ke(e.context) ? (t = "", o = r = n = 0, i = 1) : (t = e.context.a2Key, n = e.context.tinyID, 
        r = e.context.SDKAppID, o = e.context.contentType, i = e.context.apn), {
            platform: Bn,
            websdkappid: Fn,
            v: xn,
            a2: t,
            tinyid: n,
            sdkappid: r,
            contentType: o,
            apn: i,
            reqtime: function() {
                return +new Date();
            }
        };
    }, qa = function() {
        function t(e) {
            a(this, t), this.isReady = 0, this.tim = e, this.context = e.context, this._initList(), 
            this._updateWhenCTXIsReady();
        }
        return i(t, [ {
            key: "_updateWhenCTXIsReady",
            value: function() {
                this.tim.innerEmitter.on($n, this.update, this), this.tim.innerEmitter.on(zn, this.reset, this);
            }
        }, {
            key: "update",
            value: function(e) {
                var t = e.context;
                this.context = t, this._initList();
            }
        }, {
            key: "reset",
            value: function(e) {
                this.context = e.data, this._initList();
            }
        }, {
            key: "get",
            value: function(e) {
                var t = e.name, n = e.action, r = e.param, o = e.tjgID;
                if (void 0 === this.config[t]) throw new qn({
                    code: Et,
                    message: "".concat(Pn, ": PackageConfig.").concat(t)
                });
                if (void 0 === this.config[t][n]) throw new qn({
                    code: Et,
                    message: "".concat(Pn, ": PackageConfig.").concat(t, ".").concat(n)
                });
                var i = function e(t) {
                    if (0 === Object.getOwnPropertyNames(t).length) return Object.create(null);
                    var n = Array.isArray(t) ? [] : Object.create(null), r = "";
                    for (var o in t) null !== t[o] ? void 0 !== t[o] ? (r = s(t[o]), 0 <= [ "string", "number", "function", "boolean" ].indexOf(r) ? n[o] = t[o] : n[o] = e(t[o])) : n[o] = void 0 : n[o] = null;
                    return n;
                }(this.config[t][n]);
                return i.requestData = this._initRequestData(r, i), i.encode = this._initEncoder(i), 
                i.decode = this._initDecoder(i), o && (i.queryString.tjg_id = o), i;
            }
        }, {
            key: "set",
            value: function(e) {
                var t = e.key, n = e.value;
                if (0 != !!t) {
                    var r = t.split(".");
                    r.length <= 0 || function e(t, n, r, o) {
                        var i = n[r];
                        "object" === s(t[i]) ? e(t[i], n, r + 1, o) : t[i] = o;
                    }(this.config, r, 0, n);
                }
            }
        }, {
            key: "_initList",
            value: function() {
                var e, t, n, r, o, i, s, a, u, c, l, p, h, f, g, d, m, y, v, _, I, C, M, D, S, k, T, E, A, w, L, R, P, O, b, N, G, U, q, x, F;
                this.config = {}, this.config.accessLayer = (e = this.tim, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.WEB_IM,
                        cmd: Vn.CMD.ACCESS_LAYER,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            platform: Bn,
                            identifier: e.loginInfo.identifier,
                            usersig: e.loginInfo.userSig,
                            contentType: e.loginInfo.contentType,
                            apn: null !== e.context ? e.context.apn : 1,
                            websdkappid: Fn,
                            v: xn
                        },
                        requestData: {}
                    },
                    update: null,
                    delete: null
                }), this.config.login = (F = this.tim, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.LOGIN,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            identifier: F.loginInfo.identifier,
                            usersig: F.loginInfo.userSig,
                            sdkappid: F.loginInfo.SDKAppID,
                            accounttype: F.loginInfo.accountType,
                            contentType: null !== F.context ? F.context.contentType : 0,
                            apn: null !== F.context ? F.context.apn : 1,
                            reqtime: +new Date() / 1e3
                        },
                        requestData: {
                            state: "Online"
                        },
                        keyMaps: {
                            request: {
                                tinyID: "tinyId"
                            },
                            response: {
                                TinyId: "tinyID"
                            }
                        }
                    },
                    update: null,
                    delete: null
                }), this.config.logout = (x = this.tim, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.LOGOUT_ALL,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            a2: null !== x.context ? x.context.a2Key : "",
                            tinyid: null !== x.context ? x.context.tinyID : "",
                            sdkappid: null !== x.loginInfo ? x.loginInfo.SDKAppID : 0,
                            contentType: null !== x.context ? x.context.contentType : 0,
                            apn: null !== x.context ? x.context.apn : "",
                            reqtime: +new Date() / 1e3
                        },
                        requestData: {}
                    },
                    update: null,
                    delete: null
                }), this.config.longPollLogout = (q = this.tim, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.LOGOUT_LONG_POLL,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            a2: null !== q.context ? q.context.a2Key : "",
                            tinyid: null !== q.context ? q.context.tinyID : 0,
                            sdkappid: null !== q.context ? q.context.SDKAppID : 0,
                            contentType: null !== q.context ? q.context.contentType : 0,
                            apn: null !== q.context ? q.context.apn : 1,
                            reqtime: function() {
                                return Date.now();
                            }
                        },
                        requestData: {
                            longPollID: ""
                        },
                        keyMaps: {
                            request: {
                                longPollID: "LongPollingId"
                            }
                        }
                    },
                    update: null,
                    delete: null
                }), this.config.profile = function(e) {
                    var t = Ua(e), n = Vn.NAME.PROFILE, r = Vn.CHANNEL.XHR, o = [];
                    for (var i in Qr) Object.prototype.hasOwnProperty.call(Qr, i) && o.push(Qr[i]);
                    return {
                        query: {
                            serverName: n,
                            cmd: Vn.CMD.PORTRAIT_GET,
                            channel: r,
                            protocol: "json",
                            method: "POST",
                            queryString: t,
                            requestData: {
                                fromAccount: "",
                                toAccount: [],
                                tagList: o
                            }
                        },
                        update: {
                            serverName: n,
                            cmd: Vn.CMD.PORTRAIT_SET,
                            channel: r,
                            protocol: "json",
                            method: "POST",
                            queryString: t,
                            requestData: {
                                fromAccount: "",
                                profileItem: [ {
                                    tag: Qr.NICK,
                                    value: ""
                                }, {
                                    tag: Qr.GENDER,
                                    value: ""
                                }, {
                                    tag: Qr.ALLOWTYPE,
                                    value: ""
                                }, {
                                    tag: Qr.AVATAR,
                                    value: ""
                                } ]
                            }
                        }
                    };
                }(this.tim), this.config.group = (N = this.tim, G = {
                    websdkappid: Fn,
                    v: xn,
                    platform: Bn,
                    a2: null !== N.context && N.context.a2Key ? N.context.a2Key : void 0,
                    tinyid: null !== N.context && N.context.tinyID ? N.context.tinyID : void 0,
                    sdkappid: null !== N.context ? N.context.SDKAppID : 0,
                    contentType: null !== N.context ? N.context.contentType : 0,
                    accounttype: null !== N.context ? N.context.accountType : 0
                }, U = {
                    request: {
                        ownerID: "Owner_Account",
                        userID: "Member_Account",
                        newOwnerID: "NewOwner_Account",
                        maxMemberNum: "MaxMemberCount",
                        groupCustomField: "AppDefinedData",
                        memberCustomField: "AppMemberDefinedData",
                        groupCustomFieldFilter: "AppDefinedDataFilter_Group",
                        memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember",
                        messageRemindType: "MsgFlag",
                        userIDList: "MemberList",
                        groupIDList: "GroupIdList",
                        applyMessage: "ApplyMsg",
                        muteTime: "ShutUpTime",
                        joinOption: "ApplyJoinOption"
                    },
                    response: {
                        GroupIdList: "groups",
                        MsgFlag: "messageRemindType",
                        AppDefinedData: "groupCustomField",
                        AppMemberDefinedData: "memberCustomField",
                        AppDefinedDataFilter_Group: "groupCustomFieldFilter",
                        AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter",
                        InfoSeq: "infoSequence",
                        MemberList: "members",
                        GroupInfo: "groups",
                        ShutUpUntil: "muteUntil",
                        ApplyJoinOption: "joinOption"
                    }
                }, {
                    create: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.CREATE_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            type: B.GRP_PRIVATE,
                            name: void 0,
                            groupID: void 0,
                            ownerID: N.loginInfo.identifier,
                            introduction: void 0,
                            notification: void 0,
                            avatar: void 0,
                            maxMemberNum: void 0,
                            joinOption: void 0,
                            memberList: void 0,
                            groupCustomField: void 0
                        },
                        keyMaps: U
                    },
                    list: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_JOINED_GROUPS,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            userID: N.loginInfo.identifier,
                            limit: void 0,
                            offset: void 0,
                            groupType: void 0,
                            responseFilter: void 0
                        },
                        keyMaps: U
                    },
                    query: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_GROUP_INFO,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupIDList: void 0,
                            responseFilter: void 0
                        },
                        keyMaps: U
                    },
                    getGroupMemberProfile: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_GROUP_MEMBER_INFO,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            userIDList: void 0,
                            memberInfoFilter: void 0,
                            memberCustomFieldFilter: void 0
                        },
                        keyMaps: {
                            request: H({}, U.request, {
                                userIDList: "Member_List_Account"
                            }),
                            response: U.response
                        }
                    },
                    getGroupMemberList: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_GROUP_MEMBER_LIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            limit: 0,
                            offset: 0,
                            memberRoleFilter: void 0,
                            memberInfoFilter: void 0
                        },
                        keyMaps: U
                    },
                    quitGroup: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.QUIT_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0
                        }
                    },
                    changeGroupOwner: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.CHANGE_GROUP_OWNER,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            newOwnerID: void 0
                        },
                        keyMaps: U
                    },
                    destroyGroup: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.DESTROY_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0
                        }
                    },
                    updateGroupProfile: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.MODIFY_GROUP_INFO,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            name: void 0,
                            introduction: void 0,
                            notification: void 0,
                            avatar: void 0,
                            maxMemberNum: void 0,
                            joinOption: void 0,
                            groupCustomField: void 0
                        },
                        keyMaps: {
                            request: H({}, U.request, {
                                groupCustomField: "AppDefinedData"
                            }),
                            response: U.response
                        }
                    },
                    modifyGroupMemberInfo: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.MODIFY_GROUP_MEMBER_INFO,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            userID: void 0,
                            messageRemindType: void 0,
                            nameCard: void 0,
                            role: void 0,
                            memberCustomField: void 0,
                            muteTime: void 0
                        },
                        keyMaps: U
                    },
                    addGroupMember: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.ADD_GROUP_MEMBER,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            silence: void 0,
                            userIDList: void 0
                        },
                        keyMaps: U
                    },
                    deleteGroupMember: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.DELETE_GROUP_MEMBER,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            userIDList: void 0,
                            reason: void 0
                        },
                        keyMaps: {
                            request: {
                                userIDList: "MemberToDel_Account"
                            }
                        }
                    },
                    searchGroupByID: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.SEARCH_GROUP_BY_ID,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupIDList: void 0,
                            responseFilter: {
                                groupBasePublicInfoFilter: [ "Type", "Name", "Introduction", "Notification", "FaceUrl", "CreateTime", "Owner_Account", "LastInfoTime", "LastMsgTime", "NextMsgSeq", "MemberNum", "MaxMemberNum", "ApplyJoinOption" ]
                            }
                        },
                        keyMaps: {
                            request: {
                                groupIDList: "GroupIdList"
                            }
                        }
                    },
                    applyJoinGroup: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.APPLY_JOIN_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            applyMessage: void 0,
                            userDefinedField: void 0
                        },
                        keyMaps: U
                    },
                    applyJoinAVChatRoom: {
                        serverName: Vn.NAME.BIG_GROUP_NO_AUTH,
                        cmd: Vn.CMD.APPLY_JOIN_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            sdkappid: null !== N.context ? N.context.SDKAppID : 0,
                            contentType: null !== N.context ? N.context.contentType : 0,
                            accounttype: null !== N.context ? N.context.accountType : 0
                        },
                        requestData: {
                            groupID: void 0,
                            applyMessage: void 0,
                            userDefinedField: void 0
                        },
                        keyMaps: U
                    },
                    handleApplyJoinGroup: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.HANDLE_APPLY_JOIN_GROUP,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            groupID: void 0,
                            applicant: void 0,
                            handleAction: void 0,
                            handleMessage: void 0,
                            authentication: void 0,
                            messageKey: void 0,
                            userDefinedField: void 0
                        },
                        keyMaps: {
                            request: {
                                applicant: "Applicant_Account",
                                handleAction: "HandleMsg",
                                handleMessage: "ApprovalMsg",
                                messageKey: "MsgKey"
                            },
                            response: {
                                MsgKey: "messageKey"
                            }
                        }
                    },
                    deleteGroupSystemNotice: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.DELETE_GROUP_SYSTEM_MESSAGE,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            messageListToDelete: void 0
                        },
                        keyMaps: {
                            request: {
                                messageListToDelete: "DelMsgList",
                                messageSeq: "MsgSeq",
                                messageRandom: "MsgRandom"
                            }
                        }
                    },
                    getGroupPendency: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_GROUP_PENDENCY,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: G,
                        requestData: {
                            startTime: void 0,
                            limit: void 0,
                            handleAccount: void 0
                        },
                        keyMaps: {
                            request: {
                                handleAccount: "Handle_Account"
                            }
                        }
                    }
                }), this.config.longPollID = (b = this.tim, {
                    create: {},
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.GET_LONG_POLL_ID,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            a2: null !== b.context ? b.context.a2Key : "",
                            tinyid: null !== b.context ? b.context.tinyID : 0,
                            sdkappid: null !== b.context ? b.context.SDKAppID : 0,
                            contentType: null !== b.context ? b.context.contentType : 0,
                            apn: null !== b.context ? b.context.apn : 1,
                            reqtime: +new Date() / 1e3
                        },
                        requestData: {},
                        keyMaps: {
                            response: {
                                LongPollingId: "longPollingID"
                            }
                        }
                    },
                    update: {},
                    delete: {}
                }), this.config.longPoll = (P = this.tim, O = {
                    websdkappid: Fn,
                    v: xn,
                    platform: Bn,
                    a2: null !== P.context ? P.context.a2Key : "",
                    tinyid: null !== P.context ? P.context.tinyID : 0,
                    sdkappid: null !== P.context ? P.context.SDKAppID : 0,
                    contentType: null !== P.context ? P.context.contentType : 0,
                    accounttype: null !== P.context ? P.loginInfo.accountType : 0,
                    apn: null !== P.context ? P.context.apn : 1,
                    reqtime: Math.ceil(+new Date() / 1e3)
                }, {
                    create: {},
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.LONG_POLL,
                        channel: Vn.CHANNEL.AUTO,
                        protocol: jn,
                        queryString: O,
                        requestData: {
                            timeout: null,
                            cookie: {
                                notifySeq: 0,
                                noticeSeq: 0,
                                longPollingID: 0
                            }
                        },
                        keyMaps: {
                            response: {
                                C2cMsgArray: "C2CMessageArray",
                                GroupMsgArray: "groupMessageArray",
                                GroupTips: "groupTips",
                                C2cNotifyMsgArray: "C2CNotifyMessageArray",
                                ClientSeq: "clientSequence",
                                MsgPriority: "messagePriority",
                                NoticeSeq: "noticeSequence",
                                MsgContent: "content",
                                MsgType: "type",
                                MsgBody: "elements",
                                ToGroupId: "to",
                                Desc: "description",
                                Ext: "extension"
                            }
                        }
                    },
                    update: {},
                    delete: {}
                }), this.config.applyC2C = (E = this.tim, A = Ua(E), w = Vn.NAME.FRIEND, L = Vn.CHANNEL.XHR, 
                R = jn, {
                    create: {
                        serverName: w,
                        cmd: Vn.CMD.FRIEND_ADD,
                        channel: L,
                        protocol: R,
                        queryString: A,
                        requestData: {
                            fromAccount: "",
                            addFriendItem: []
                        }
                    },
                    get: {
                        serverName: w,
                        cmd: Vn.CMD.GET_PENDENCY,
                        channel: L,
                        protocol: R,
                        queryString: A,
                        requestData: {
                            fromAccount: "",
                            pendencyType: "Pendency_Type_ComeIn"
                        }
                    },
                    update: {
                        serverName: w,
                        cmd: Vn.CMD.RESPONSE_PENDENCY,
                        channel: L,
                        protocol: R,
                        queryString: A,
                        requestData: {
                            fromAccount: "",
                            responseFriendItem: []
                        }
                    },
                    delete: {
                        serverName: w,
                        cmd: Vn.CMD.DELETE_PENDENCY,
                        channel: L,
                        protocol: R,
                        queryString: A,
                        requestData: {
                            fromAccount: "",
                            toAccount: [],
                            pendencyType: "Pendency_Type_ComeIn"
                        }
                    }
                }), this.config.friend = (D = this.tim, S = Ua(D), k = Vn.NAME.FRIEND, T = Vn.CHANNEL.XHR, 
                {
                    get: {
                        serverName: k,
                        cmd: Vn.CMD.FRIEND_GET_ALL,
                        channel: T,
                        protocol: "json",
                        method: "POST",
                        queryString: S,
                        requestData: {
                            fromAccount: "",
                            timeStamp: 0,
                            startIndex: 0,
                            getCount: 100,
                            lastStandardSequence: 0,
                            tagList: [ "Tag_Profile_IM_Nick", "Tag_SNS_IM_Remark" ]
                        },
                        keyMaps: {
                            request: {},
                            response: {}
                        }
                    },
                    delete: {
                        serverName: k,
                        cmd: Vn.CMD.FRIEND_DELETE,
                        channel: T,
                        protocol: "json",
                        method: "POST",
                        queryString: S,
                        requestData: {
                            fromAccount: "",
                            toAccount: [],
                            deleteType: "Delete_Type_Single"
                        }
                    }
                }), this.config.blacklist = (C = this.tim, M = Ua(C), {
                    create: {
                        serverName: Vn.NAME.FRIEND,
                        cmd: Vn.CMD.ADD_BLACKLIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: M,
                        requestData: {
                            fromAccount: "",
                            toAccount: []
                        }
                    },
                    get: {
                        serverName: Vn.NAME.FRIEND,
                        cmd: Vn.CMD.GET_BLACKLIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: M,
                        requestData: {
                            fromAccount: "",
                            startIndex: 0,
                            maxLimited: 30,
                            lastSequence: 0
                        }
                    },
                    delete: {
                        serverName: Vn.NAME.FRIEND,
                        cmd: Vn.CMD.DELETE_BLACKLIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: M,
                        requestData: {
                            fromAccount: "",
                            toAccount: []
                        }
                    },
                    update: {}
                }), this.config.c2cMessage = (v = this.tim, _ = {
                    platform: Bn,
                    websdkappid: Fn,
                    v: xn,
                    a2: null !== v.context ? v.context.a2Key : "",
                    tinyid: null !== v.context ? v.context.tinyID : 0,
                    sdkappid: null !== v.context ? v.context.SDKAppID : 0,
                    contentType: null !== v.context ? v.context.contentType : 0,
                    apn: null !== v.context ? v.context.apn : 1,
                    reqtime: function() {
                        return +new Date();
                    }
                }, I = {
                    request: {
                        fromAccount: "From_Account",
                        toAccount: "To_Account",
                        msgTimeStamp: "MsgTimeStamp",
                        msgSeq: "MsgSeq",
                        msgRandom: "MsgRandom",
                        msgBody: "MsgBody",
                        count: "MaxCnt",
                        lastMessageTime: "LastMsgTime",
                        messageKey: "MsgKey",
                        peerAccount: "Peer_Account",
                        data: "Data",
                        description: "Desc",
                        extension: "Ext",
                        type: "MsgType",
                        content: "MsgContent",
                        sizeType: "Type",
                        uuid: "UUID",
                        imageUrl: "URL",
                        fileUrl: "Url",
                        remoteAudioUrl: "Url",
                        remoteVideoUrl: "VideoUrl",
                        thumbUUID: "ThumbUUID",
                        videoUUID: "VideoUUID",
                        videoUrl: "",
                        downloadFlag: "Download_Flag"
                    },
                    response: {
                        MsgContent: "content",
                        MsgTime: "time",
                        Data: "data",
                        Desc: "description",
                        Ext: "extension",
                        MsgKey: "messageKey",
                        MsgType: "type",
                        MsgBody: "elements",
                        Download_Flag: "downloadFlag"
                    }
                }, {
                    create: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.SEND_MESSAGE,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: _,
                        requestData: {
                            fromAccount: v.loginInfo.identifier,
                            toAccount: "",
                            msgTimeStamp: Math.ceil(+new Date() / 1e3),
                            msgSeq: 0,
                            msgRandom: 0,
                            msgBody: []
                        },
                        keyMaps: I
                    },
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.GET_C2C_ROAM_MESSAGES,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: _,
                        requestData: {
                            peerAccount: "",
                            count: 15,
                            lastMessageTime: 0,
                            messageKey: ""
                        },
                        keyMaps: I
                    },
                    update: null,
                    delete: null
                }), this.config.groupMessage = (d = this.tim, m = {
                    platform: Bn,
                    websdkappid: Fn,
                    v: xn,
                    a2: null !== d.context ? d.context.a2Key : "",
                    tinyid: null !== d.context ? d.context.tinyID : 0,
                    sdkappid: null !== d.context ? d.context.SDKAppID : 0,
                    contentType: null !== d.context ? d.context.contentType : 0,
                    apn: null !== d.context ? d.context.apn : 1,
                    reqtime: function() {
                        return +new Date();
                    }
                }, y = {
                    request: {
                        to: "GroupId",
                        extension: "Ext",
                        data: "Data",
                        description: "Desc",
                        random: "Random",
                        sequence: "ReqMsgSeq",
                        count: "ReqMsgNumber",
                        type: "MsgType",
                        content: "MsgContent",
                        elements: "MsgBody",
                        sizeType: "Type",
                        uuid: "UUID",
                        imageUrl: "URL",
                        fileUrl: "Url",
                        remoteAudioUrl: "Url",
                        remoteVideoUrl: "VideoUrl",
                        thumbUUID: "ThumbUUID",
                        videoUUID: "VideoUUID",
                        videoUrl: "",
                        downloadFlag: "Download_Flag",
                        clientSequence: "ClientSeq"
                    },
                    response: {
                        Random: "random",
                        MsgTime: "time",
                        MsgSeq: "sequence",
                        ReqMsgSeq: "sequence",
                        RspMsgList: "messageList",
                        IsPlaceMsg: "isPlaceMessage",
                        IsSystemMsg: "isSystemMessage",
                        ToGroupId: "to",
                        EnumFrom_AccountType: "fromAccountType",
                        EnumTo_AccountType: "toAccountType",
                        GroupCode: "groupCode",
                        MsgFlag: "messageRemindType",
                        MsgPriority: "messagePriority",
                        MsgBody: "elements",
                        MsgType: "type",
                        MsgContent: "content",
                        IsFinished: "complete",
                        Download_Flag: "downloadFlag",
                        ClientSeq: "clientSequence"
                    }
                }, {
                    create: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.SEND_GROUP_MESSAGE,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: m,
                        requestData: {
                            groupID: "",
                            fromAccount: d.loginInfo.identifier,
                            random: 0,
                            clientSequence: 0,
                            msgBody: []
                        },
                        keyMaps: y
                    },
                    query: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.GET_GROUP_ROAM_MESSAGES,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: m,
                        requestData: {
                            groupID: "",
                            count: 15,
                            sequence: ""
                        },
                        keyMaps: y
                    },
                    update: null,
                    delete: null
                }), this.config.conversation = (f = this.tim, g = {
                    platform: Bn,
                    websdkappid: Fn,
                    v: xn,
                    a2: null !== f.context ? f.context.a2Key : "",
                    tinyid: null !== f.context ? f.context.tinyID : 0,
                    sdkappid: null !== f.context ? f.context.SDKAppID : 0,
                    contentType: null !== f.context ? f.context.contentType : 0,
                    apn: null !== f.context ? f.context.apn : 1
                }, {
                    query: {
                        serverName: Vn.NAME.RECENT_CONTACT,
                        cmd: Vn.CMD.GET_CONVERSATION_LIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: g,
                        requestData: {
                            fromAccount: f.loginInfo.identifier,
                            count: 0
                        },
                        keyMaps: {
                            request: {},
                            response: {
                                SessionItem: "conversations",
                                ToAccount: "groupID",
                                To_Account: "userID",
                                UnreadMsgCount: "unreadCount",
                                MsgGroupReadedSeq: "messageReadSeq"
                            }
                        }
                    },
                    pagingQuery: {
                        serverName: Vn.NAME.RECENT_CONTACT,
                        cmd: Vn.CMD.PAGING_GET_CONVERSATION_LIST,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: g,
                        requestData: {
                            fromAccount: void 0,
                            timeStamp: void 0,
                            orderType: void 0
                        },
                        keyMaps: {
                            request: {},
                            response: {
                                SessionItem: "conversations",
                                ToAccount: "groupID",
                                To_Account: "userID",
                                UnreadMsgCount: "unreadCount",
                                MsgGroupReadedSeq: "messageReadSeq"
                            }
                        }
                    },
                    delete: {
                        serverName: Vn.NAME.RECENT_CONTACT,
                        cmd: Vn.CMD.DELETE_CONVERSATION,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: g,
                        requestData: {
                            fromAccount: f.loginInfo.identifier,
                            toAccount: void 0,
                            type: 1,
                            toGroupID: void 0
                        },
                        keyMaps: {
                            request: {
                                toGroupID: "ToGroupid"
                            }
                        }
                    },
                    setC2CMessageRead: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.SET_C2C_MESSAGE_READ,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: g,
                        requestData: {
                            C2CMsgReaded: void 0
                        },
                        keyMaps: {
                            request: {
                                lastMessageTime: "LastedMsgTime"
                            }
                        }
                    },
                    setGroupMessageRead: {
                        serverName: Vn.NAME.GROUP,
                        cmd: Vn.CMD.SET_GROUP_MESSAGE_READ,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: g,
                        requestData: {
                            groupID: void 0,
                            messageReadSeq: void 0
                        },
                        keyMaps: {
                            request: {
                                messageReadSeq: "MsgReadedSeq"
                            }
                        }
                    }
                }), this.config.syncMessage = (p = this.tim, h = {
                    platform: Bn,
                    websdkappid: Fn,
                    v: xn,
                    a2: null !== p.context ? p.context.a2Key : "",
                    tinyid: null !== p.context ? p.context.tinyID : 0,
                    sdkappid: null !== p.context ? p.context.SDKAppID : 0,
                    contentType: null !== p.context ? p.context.contentType : 0,
                    apn: null !== p.context ? p.context.apn : 1,
                    reqtime: function() {
                        return [ Math.ceil(+new Date()), Math.random() ].join("");
                    }
                }, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.GET_MESSAGES,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: h,
                        requestData: {
                            cookie: "",
                            syncFlag: 0,
                            needAbstract: 1
                        },
                        keyMaps: {
                            request: {
                                fromAccount: "From_Account",
                                toAccount: "To_Account",
                                from: "From_Account",
                                to: "To_Account",
                                time: "MsgTimeStamp",
                                sequence: "MsgSeq",
                                random: "MsgRandom",
                                elements: "MsgBody"
                            },
                            response: {
                                MsgList: "messageList",
                                SyncFlag: "syncFlag",
                                To_Account: "to",
                                From_Account: "from",
                                ClientSeq: "clientSequence",
                                MsgSeq: "sequence",
                                NoticeSeq: "noticeSequence",
                                NotifySeq: "notifySequence",
                                MsgRandom: "random",
                                MsgTimeStamp: "time",
                                MsgContent: "content",
                                ToGroupId: "groupID",
                                MsgKey: "messageKey",
                                GroupTips: "groupTips",
                                MsgBody: "elements",
                                MsgType: "type",
                                C2CRemainingUnreadCount: "C2CRemainingUnreadList"
                            }
                        }
                    },
                    update: null,
                    delete: null
                }), this.config.AVChatRoom = (l = this.tim, {
                    startLongPoll: {
                        serverName: Vn.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,
                        cmd: Vn.CMD.AVCHATROOM_LONG_POLL,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            sdkappid: l.loginInfo.SDKAppID,
                            accounttype: "792",
                            apn: null !== l.context ? l.context.apn : 1,
                            reqtime: function() {
                                return +new Date();
                            }
                        },
                        requestData: {
                            USP: 1,
                            startSeq: 1,
                            holdTime: 90,
                            key: void 0
                        },
                        keyMaps: {
                            request: {
                                USP: "USP"
                            },
                            response: {
                                ToGroupId: "groupID"
                            }
                        }
                    }
                }), this.config.cosUpload = (u = this.tim, c = {
                    platform: Bn,
                    websdkappid: Fn,
                    v: xn,
                    a2: null !== u.context ? u.context.a2Key : "",
                    tinyid: null !== u.context ? u.context.tinyID : 0,
                    sdkappid: null !== u.context ? u.context.SDKAppID : 0,
                    contentType: null !== u.context ? u.context.contentType : 0,
                    apn: null !== u.context ? u.context.apn : 1,
                    reqtime: function() {
                        return Date.now();
                    }
                }, {
                    create: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.FILE_UPLOAD,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: c,
                        requestData: {
                            appVersion: "2.1",
                            fromAccount: "",
                            toAccount: "",
                            sequence: 0,
                            time: function() {
                                return Math.ceil(Date.now() / 1e3);
                            },
                            random: function() {
                                return fe();
                            },
                            fileStrMd5: "",
                            fileSize: "",
                            serverVer: 1,
                            authKey: "",
                            busiId: 1,
                            pkgFlag: 1,
                            sliceOffset: 0,
                            sliceSize: 0,
                            sliceData: "",
                            contentType: "application/x-www-form-urlencoded"
                        },
                        keyMaps: {
                            request: {},
                            response: {}
                        }
                    },
                    update: null,
                    delete: null
                }), this.config.cosSig = (s = this.tim, a = {
                    sdkappid: function() {
                        return s.loginInfo.SDKAppID;
                    },
                    identifier: function() {
                        return s.loginInfo.identifier;
                    },
                    userSig: function() {
                        return s.context.userSig;
                    }
                }, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.IM_COS_SIGN,
                        cmd: Vn.CMD.COS_SIGN,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: a,
                        requestData: {
                            cmd: "open_im_cos_svc",
                            subCmd: "get_cos_token",
                            duration: 300,
                            version: 1
                        },
                        keyMaps: {
                            request: {
                                userSig: "usersig",
                                subCmd: "sub_cmd",
                                cmd: "cmd",
                                duration: "duration",
                                version: "version"
                            },
                            response: {
                                expired_time: "expiredTime",
                                bucket_name: "bucketName",
                                session_token: "sessionToken",
                                tmp_secret_id: "secretId",
                                tmp_secret_key: "secretKey"
                            }
                        }
                    },
                    update: null,
                    delete: null
                }), this.config.bigDataHallwayAuthKey = (i = this.tim, {
                    create: null,
                    query: {
                        serverName: Vn.NAME.OPEN_IM,
                        cmd: Vn.CMD.BIG_DATA_HALLWAY_AUTH_KEY,
                        channel: Vn.CHANNEL.XHR,
                        protocol: jn,
                        method: "POST",
                        queryString: {
                            websdkappid: Fn,
                            v: xn,
                            platform: Bn,
                            sdkappid: i.loginInfo.SDKAppID,
                            accounttype: "792",
                            apn: null !== i.context ? i.context.apn : 1,
                            reqtime: function() {
                                return +new Date();
                            }
                        },
                        requestData: {}
                    }
                }), this.config.ssoEventStat = (r = this.tim, (o = null) !== r.context && (o = {
                    sdkappid: r.context.SDKAppID,
                    reqtime: Math.ceil(+new Date() / 1e3)
                }), {
                    create: {
                        serverName: Vn.NAME.IM_OPEN_STAT,
                        cmd: Vn.CMD.TIM_WEB_REPORT,
                        channel: Vn.CHANNEL.AUTO,
                        protocol: jn,
                        queryString: o,
                        requestData: {
                            table: "",
                            report: []
                        },
                        keyMaps: {
                            request: {
                                table: "table",
                                report: "report",
                                SDKAppID: "sdkappid",
                                version: "version",
                                tinyID: "tinyid",
                                userID: "userid",
                                platform: "platform",
                                method: "method",
                                time: "time",
                                start: "start",
                                end: "end",
                                cost: "cost",
                                status: "status",
                                codeint: "code",
                                message: "message",
                                pointer: "pointer",
                                text: "text",
                                msgType: "msgtype",
                                networkType: "networktype",
                                startts: "startts",
                                endts: "endts",
                                timespan: "timespan"
                            }
                        }
                    },
                    query: {},
                    update: {},
                    delete: {}
                }), this.config.ssoSumStat = (t = this.tim, (n = null) !== t.context && (n = {
                    sdkappid: t.context.SDKAppID,
                    reqtime: Math.ceil(+new Date() / 1e3)
                }), {
                    create: {
                        serverName: Vn.NAME.IM_OPEN_STAT,
                        cmd: Vn.CMD.TIM_WEB_REPORT,
                        channel: Vn.CHANNEL.AUTO,
                        protocol: jn,
                        queryString: n,
                        requestData: {
                            table: "",
                            report: []
                        },
                        keyMaps: {
                            request: {
                                table: "table",
                                report: "report",
                                SDKAppID: "sdkappid",
                                version: "version",
                                tinyID: "tinyid",
                                userID: "userid",
                                item: "item",
                                lpID: "lpid",
                                platform: "platform",
                                networkType: "networktype",
                                total: "total",
                                successRate: "successrate",
                                avg: "avg",
                                timespan: "timespan",
                                time: "time"
                            }
                        }
                    },
                    query: {},
                    update: {},
                    delete: {}
                });
            }
        }, {
            key: "_initRequestData",
            value: function(e, t) {
                if (void 0 === e) return Ur(t.requestData, this._getRequestMap(t), this.tim);
                var n = t.requestData, r = Object.create(null);
                for (var o in n) if (Object.prototype.hasOwnProperty.call(n, o)) {
                    if (r[o] = "function" == typeof n[o] ? n[o]() : n[o], void 0 === e[o]) continue;
                    r[o] = e[o];
                }
                return Ur(r, this._getRequestMap(t), this.tim);
            }
        }, {
            key: "_getRequestMap",
            value: function(e) {
                if (e.keyMaps && e.keyMaps.request && 0 < Object.keys(e.keyMaps.request).length) return e.keyMaps.request;
            }
        }, {
            key: "_initEncoder",
            value: function(e) {
                switch (e.protocol) {
                  case jn:
                    return function(t) {
                        if ("string" === s(t)) try {
                            return JSON.parse(t);
                        } catch (e) {
                            return t;
                        }
                        return t;
                    };

                  case Hn:
                    return function(e) {
                        return e;
                    };

                  default:
                    return function(e) {
                        return $.warn("PackageConfig._initEncoder(), unknow response type, data: ", JSON.stringify(e)), 
                        e;
                    };
                }
            }
        }, {
            key: "_initDecoder",
            value: function(e) {
                switch (e.protocol) {
                  case jn:
                    return function(t) {
                        if ("string" === s(t)) try {
                            return JSON.parse(t);
                        } catch (e) {
                            return t;
                        }
                        return t;
                    };

                  case Hn:
                    return function(e) {
                        return e;
                    };

                  default:
                    return function(e) {
                        return $.warn("PackageConfig._initDecoder(), unknow response type, data: ", e), 
                        e;
                    };
                }
            }
        } ]), t;
    }(), xa = {
        C2CMessageArray: 1,
        groupMessageArray: 1,
        groupTips: 1,
        C2CNotifyMessageArray: 1,
        profileModify: 1,
        friendListMod: 1
    }, Fa = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initialization(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initialization",
            value: function() {
                this._syncOffset = "", this._syncNoticeList = [], this._syncEventArray = [], this._syncMessagesIsRunning = 0, 
                this._syncMessagesFinished = 0, this._isLongPoll = 0, this._longPollID = 0, this._noticeSequence = 0, 
                this._initializeListener(), this._runLoop = null, this._initShuntChannels();
            }
        }, {
            key: "_initShuntChannels",
            value: function() {
                this._shuntChannels = Object.create(null), this._shuntChannels.C2CMessageArray = this._C2CMessageArrayChannel.bind(this), 
                this._shuntChannels.groupMessageArray = this._groupMessageArrayChannel.bind(this), 
                this._shuntChannels.groupTips = this._groupTipsChannel.bind(this), this._shuntChannels.C2CNotifyMessageArray = this._C2CNotifyMessageArrayChannel.bind(this), 
                this._shuntChannels.profileModify = this._profileModifyChannel.bind(this), this._shuntChannels.friendListMod = this._friendListModChannel.bind(this);
            }
        }, {
            key: "_C2CMessageArrayChannel",
            value: function(e, t, n) {
                this.tim.innerEmitter.emit(dr, {
                    data: t,
                    type: n
                });
            }
        }, {
            key: "_groupMessageArrayChannel",
            value: function(e, t, n) {
                this.tim.innerEmitter.emit(mr, {
                    data: t
                });
            }
        }, {
            key: "_groupTipsChannel",
            value: function(e, t, n) {
                switch (e) {
                  case 4:
                    this.tim.innerEmitter.emit(yr, {
                        data: t
                    });
                    break;

                  case 5:
                    this.tim.innerEmitter.emit(vr, {
                        data: {
                            groupSystemNotices: t,
                            type: n
                        }
                    });
                    break;

                  default:
                    $.warn("未知的群事件类型 Event:".concat(e));
                }
            }
        }, {
            key: "_C2CNotifyMessageArrayChannel",
            value: function(e, t, n) {
                this._isKickedoutNotice(t) ? this.tim.innerEmitter.emit(gr) : this._isSysCmdMsgNotify(t) && this.tim.innerEmitter.emit(Cr);
            }
        }, {
            key: "_profileModifyChannel",
            value: function(e, t, n) {
                this.tim.innerEmitter.emit(Ir, {
                    data: t
                });
            }
        }, {
            key: "_friendListModChannel",
            value: function(e, t, n) {
                this.tim.innerEmitter.emit(_r, {
                    data: t
                });
            }
        }, {
            key: "_dispatchNotice",
            value: function(e) {
                var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "poll";
                if (ee(e)) for (var n = this.tim.innerEmitter, r = null, o = null, i = "", s = "", a = "", u = 0, c = 0, l = e.length; c < l; c++) u = (r = e[c]).event, 
                i = Object.keys(r).find(function(e) {
                    return void 0 !== xa[e];
                }), re(this._shuntChannels[i]) ? (o = r[i], this._updatenoticeSequence(o), this._shuntChannels[i](u, o, t)) : (this._updatenoticeSequence(), 
                s = "".concat(Lt), a = "".concat(bn, ": ").concat(u, ", ").concat(i), n.emit(Ar, new qn({
                    code: s,
                    message: a,
                    data: {
                        payloadName: i,
                        event: u
                    }
                })), a = s = "");
            }
        }, {
            key: "getLongPollID",
            value: function() {
                return this._longPollID;
            }
        }, {
            key: "_IAmReady",
            value: function() {
                this.triggerReady();
            }
        }, {
            key: "reset",
            value: function() {
                this._noticeSequence = 0, this._resetSync(), this.closeNoticeChannel();
            }
        }, {
            key: "_resetSync",
            value: function() {
                this._syncOffset = "", this._syncNoticeList = [], this._syncEventArray = [], this._syncMessagesIsRunning = 0, 
                this._syncMessagesFinished = 0;
            }
        }, {
            key: "_setNoticeSeqInRequestData",
            value: function(e) {
                e.Cookie.NoticeSeq = this._noticeSequence, this.tim.sumStatController.addTotalCount(uo);
            }
        }, {
            key: "_updatenoticeSequence",
            value: function(e) {
                if (e) {
                    var t = e[e.length - 1].noticeSequence;
                    !t || "number" != typeof t || t < this._noticeSequence ? this._noticeSequence++ : this._noticeSequence = t;
                } else this._noticeSequence++;
            }
        }, {
            key: "_initializeListener",
            value: function() {
                var e = this.tim.innerEmitter;
                e.on(Mr, this.restartNoticeChannel, this), e.on(Yn, this._startSyncMessages, this), 
                e.on(Xn, this.openNoticeChannel, this), e.on(Er, this.closeNoticeChannel, this), 
                e.on(cr, this._onChannelReconnect, this), e.on(pr, this._onChannelDisconnected, this);
            }
        }, {
            key: "openNoticeChannel",
            value: function() {
                $.log("NotificationController.openNoticeChannel"), this._getLongPollID();
            }
        }, {
            key: "closeNoticeChannel",
            value: function() {
                $.log("NotificationController.closeNoticeChannel()"), (this._runLoop instanceof Us || this._runLoop instanceof qs) && (this._runLoop.abort(), 
                this._runLoop.stop()), this._longPollID = 0, this._isLongPoll = 0, this.tim.innerEmitter.emit(hr), 
                this.tim.outerEmitter.emit(l.NOTICE_LONGPOLL_STOPPED);
            }
        }, {
            key: "restartNoticeChannel",
            value: function() {
                this.closeNoticeChannel(), this._syncMessagesFinished = 0, this._startSyncMessages();
            }
        }, {
            key: "_getLongPollID",
            value: function() {
                var t = this, e = this.tim, n = e.innerEmitter, r = e.connectionController;
                if (0 === this._longPollID) {
                    var o = this.createPackage({
                        name: "longPollID",
                        action: "query"
                    });
                    r.request(o).then(function(e) {
                        e.data.errorCode === Br.SUCCESS ? t._onGetLongPollIDSuccess({
                            data: e.data.longPollingID
                        }) : t._onGetLongPollIDFail({
                            data: e.data
                        });
                    }).catch(function(e) {
                        n.emit(ir, e);
                    });
                } else this._onGetLongPollIDSuccess({
                    data: this._longPollID
                });
            }
        }, {
            key: "_onGetLongPollIDSuccess",
            value: function(e) {
                this.tim.packageConfig.set({
                    key: "long_poll_logout.query.requestData.longPollingID",
                    value: e.data
                }), this.tim.packageConfig.set({
                    key: "longPoll.query.requestData.cookie.longPollingID",
                    value: e.data
                }), this._longPollID = e.data, this._startLongPoll(), this._IAmReady(), this.tim.sumStatController.recordLongPollingID(this._longPollID);
            }
        }, {
            key: "_onGetLongPollIDFail",
            value: function(e) {
                $.warn("Notification._onGetLongPollIDFail", e);
            }
        }, {
            key: "_startLongPoll",
            value: function() {
                if (1 != this._isLongPoll) {
                    $.log("NotificationController._startLongPoll...");
                    var e = this.tim, t = e.connectionController, n = e.innerEmitter, r = this.createPackage({
                        name: "longPoll",
                        action: "query"
                    });
                    this._isLongPoll = 1, n.emit(sr, {
                        data: Date.now()
                    }), this._runLoop = t.createRunLoop({
                        pack: r,
                        before: this._setNoticeSeqInRequestData.bind(this),
                        success: this._onNoticeReceived.bind(this),
                        fail: this._onNoticeFail.bind(this)
                    }), this._runLoop.start();
                } else $.log("NotificationController._startLongPoll is running...");
            }
        }, {
            key: "_onChannelReconnect",
            value: function(e) {
                this.closeNoticeChannel(), this.syncMessage();
            }
        }, {
            key: "_onChannelDisconnected",
            value: function() {}
        }, {
            key: "_onNoticeReceived",
            value: function(e) {
                var t = this.tim, n = t.innerEmitter, r = t.statusController, o = e.data, i = !r.getChannelStatus();
                if (n.emit(ar, {
                    data: Date.now()
                }), o.errorCode !== Br.SUCCESS) {
                    var s = new go();
                    if (s.setMethod(Ao).setStart(), s.setMessage(o.errorInfo).setCode(o.errorCode).setNetworkType(this.getNetworkType()).setEnd(), 
                    o.errorCode === bt) return n.emit(fr), $.log("NotificationController._onNoticeReceived(), longPollingID was kicked"), 
                    void this.closeNoticeChannel();
                    $.log("NotificationController._onNoticeReceived(), error: ".concat(o.errorCode, ", errorInfo: ").concat(o.errorInfo)), 
                    n.emit(Ar, {
                        code: o.errorCode,
                        message: o.errorInfo
                    });
                }
                this.tim.sumStatController.addSuccessCount(uo), this.tim.sumStatController.addCost(uo, o.timecost), 
                e.data.eventArray && 1 != i && this._dispatchNotice(e.data.eventArray);
            }
        }, {
            key: "_onNoticeFail",
            value: function(n) {
                var r = new go();
                r.setMethod(Ao).setStart(), this.probeNetwork(function(e, t) {
                    r.setError(n.error, e, t).setEnd();
                }), this.tim.innerEmitter.emit(Ar, n.error), this.tim.innerEmitter.emit(ur, {
                    data: Date.now()
                });
            }
        }, {
            key: "_isKickedoutNotice",
            value: function(e) {
                return e[0].hasOwnProperty("kickoutMsgNotify") ? 1 : 0;
            }
        }, {
            key: "_isSysCmdMsgNotify",
            value: function(e) {
                if (!e[0]) return 0;
                var t = e[0];
                return Object.prototype.hasOwnProperty.call(t, "sysCmdMsgNotify") ? 1 : 0;
            }
        }, {
            key: "_startSyncMessages",
            value: function(e) {
                1 != this._syncMessagesFinished && this.syncMessage();
            }
        }, {
            key: "syncMessage",
            value: function() {
                var n = this, e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, r = this.tim, o = r.connectionController, i = r.innerEmitter;
                this._syncMessagesIsRunning = 1;
                var s = this.createPackage({
                    name: "syncMessage",
                    action: "query",
                    param: {
                        cookie: e,
                        syncFlag: t
                    }
                });
                o.request(s).then(function(e) {
                    var t = e.data;
                    switch (Ra(t.cookie, t.syncFlag)) {
                      case "00":
                      case "01":
                        i.emit(Ar, {
                            code: Rt,
                            message: Nn
                        });
                        break;

                      case "10":
                      case "11":
                        t.eventArray && n._dispatchNotice(t.eventArray, "sync"), n._syncNoticeList = n._syncNoticeList.concat(t.messageList), 
                        i.emit(Wn, {
                            data: t.messageList,
                            C2CRemainingUnreadList: t.C2CRemainingUnreadList
                        }), n._syncOffset = t.cookie, n.syncMessage(t.cookie, t.syncFlag);
                        break;

                      case "12":
                        t.eventArray && n._dispatchNotice(t.eventArray, "sync"), n._syncNoticeList = n._syncNoticeList.concat(t.messageList), 
                        i.emit(Xn, {
                            data: t.messageList,
                            C2CRemainingUnreadList: t.C2CRemainingUnreadList
                        }), n._syncOffset = t.cookie, n._syncNoticeList = [], n._syncMessagesIsRunning = 0, 
                        n._syncMessagesFinished = 1;
                    }
                }).catch(function(e) {
                    n._syncMessagesIsRunning = 0, $.error("NotificationController.syncMessage() failed, error:", JSON.stringify(e));
                });
            }
        } ]), n;
    }(), Ba = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e)))._initializeListener(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initializeMembers",
            value: function(e) {
                this.expiredTimeLimit = 300, this.appid = e.appid || "", this.bucketName = e.bucketName || "", 
                this.expiredTimeOut = e.expiredTimeOut || this.expiredTimeLimit, this.region = "ap-shanghai", 
                this.cos = null, this.cosOptions = {
                    secretId: e.secretId,
                    secretKey: e.secretKey,
                    sessionToken: e.sessionToken,
                    expiredTime: e.expiredTime
                }, this._initUploaderMethod();
            }
        }, {
            key: "_expiredTimer",
            value: function() {
                var e = this, t = setInterval(function() {
                    Math.ceil(Date.now() / 1e3) >= e.cosOptions.expiredTime - 20 && (e._isReady = 0, 
                    e._getAuthorizationKey(), clearInterval(t));
                }, 1e4);
            }
        }, {
            key: "_initializeListener",
            value: function() {
                this.tim.innerEmitter.on(Yn, this._initialization, this);
            }
        }, {
            key: "_initialization",
            value: function() {
                this._initCOSSDKPlugin(), this.COSSDK ? (this._initializeMembers({}), this._getAuthorizationKey()) : $.warn("UploadController._initialization 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin");
            }
        }, {
            key: "_getAuthorizationKey",
            value: function() {
                var n = this, r = Math.ceil(Date.now() / 1e3), e = this.createPackage({
                    name: "cosSig",
                    action: "query",
                    param: {
                        duration: this.expiredTimeLimit
                    }
                });
                this.tim.connectionController.request(e).then(function(e) {
                    var t = e.data.expiredTime - r;
                    e.data.expiredTimeOut = t, $.log("UploadController._getAuthorizationKey timeout=".concat(t, "s")), 
                    n._initializeMembers(e.data), n._expiredTimer(), n._initUploaderMethod();
                }).catch(function(e) {
                    $.warn("UploadController._getAuthorizationKey. error:", e);
                });
            }
        }, {
            key: "_initCOSSDKPlugin",
            value: function() {
                var e = E ? "cos-wx-sdk" : "cos-js-sdk";
                this.COSSDK = this.tim.getPlugin(e);
            }
        }, {
            key: "_initUploaderMethod",
            value: function() {
                var n = this;
                this.appid && (this.cos = E ? new this.COSSDK({
                    ForcePathStyle: 1,
                    getAuthorization: this._getAuthorization.bind(this)
                }) : new this.COSSDK({
                    getAuthorization: this._getAuthorization.bind(this)
                }), this._cosUploadMethod = E ? function(e, t) {
                    n.cos.postObject(e, t);
                } : function(e, t) {
                    n.cos.uploadFiles(e, t);
                }, this.triggerReady());
            }
        }, {
            key: "_getAuthorization",
            value: function(e, t) {
                t({
                    TmpSecretId: this.cosOptions.secretId,
                    TmpSecretKey: this.cosOptions.secretKey,
                    XCosSecurityToken: this.cosOptions.sessionToken,
                    ExpiredTime: this.cosOptions.expiredTime
                });
            }
        }, {
            key: "uploadImage",
            value: function(e) {
                if (!e.file) return io(new qn({
                    code: Ve,
                    message: Xt
                }));
                var t = this._checkImageType(e.file);
                if (1 != t) return t;
                var n = this._checkImageMime(e.file);
                if (1 != n) return n;
                var r = this._checkImageSize(e.file);
                return 1 != r ? r : this.upload(e);
            }
        }, {
            key: "_checkImageType",
            value: function(e) {
                var t = "";
                return t = E ? e.url.slice(e.url.lastIndexOf(".") + 1) : e.files[0].name.slice(e.files[0].name.lastIndexOf(".") + 1), 
                0 <= js.indexOf(t.toLowerCase()) ? 1 : io(new qn({
                    coe: Ke,
                    message: Jt
                }));
            }
        }, {
            key: "_checkImageMime",
            value: function(e) {
                return 1;
            }
        }, {
            key: "_checkImageSize",
            value: function(e) {
                var t;
                return 0 === (t = E ? e.size : e.files[0].size) ? io(new qn({
                    code: He,
                    message: "".concat(Yt)
                })) : t < 20971520 ? 1 : io(new qn({
                    coe: $e,
                    message: "".concat(Qt)
                }));
            }
        }, {
            key: "uploadFile",
            value: function(e) {
                var t = null;
                return e.file ? 20971520 < e.file.files[0].size ? (t = new qn({
                    code: et,
                    message: an
                }), io(t)) : 0 === e.file.files[0].size ? (t = new qn({
                    code: He,
                    message: "".concat(Yt)
                }), io(t)) : this.upload(e) : (t = new qn({
                    code: Ze,
                    message: sn
                }), io(t));
            }
        }, {
            key: "uploadVideo",
            value: function(e) {
                if (E) return 20971520 < e.file.videoFile.size ? io(new qn({
                    code: Xe,
                    message: "".concat(nn)
                })) : 0 === e.file.videoFile.size ? io(new qn({
                    code: He,
                    message: "".concat(Yt)
                })) : -1 === Vs.indexOf(e.file.videoFile.type) ? io(new qn({
                    code: Je,
                    message: "".concat(rn)
                })) : this.handleVideoUpload({
                    file: e.file.videoFile
                });
            }
        }, {
            key: "handleVideoUpload",
            value: function(n) {
                var r = this;
                return new Promise(function(t, e) {
                    r.upload(n).then(function(e) {
                        t(e);
                    }).catch(function() {
                        r.upload(n).then(function(e) {
                            t(e);
                        }).catch(function() {
                            e(new qn({
                                code: We,
                                message: tn
                            }));
                        });
                    });
                });
            }
        }, {
            key: "uploadAudio",
            value: function(e) {
                return e.file ? 20971520 < e.file.size ? io(new qn({
                    code: Ye,
                    message: "".concat(en)
                })) : 0 === e.file.size ? io(new qn({
                    code: He,
                    message: "".concat(Yt)
                })) : this.upload(e) : io(new qn({
                    code: ze,
                    message: Zt
                }));
            }
        }, {
            key: "upload",
            value: function(t) {
                var l = this;
                if (!re(this._cosUploadMethod)) return $.warn("UploadController.upload 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin"), 
                io(new qn({
                    code: Ge,
                    message: Ht
                }));
                var p = new go();
                p.setMethod(Io).setStart(), $.time(fo);
                var h = E ? t.file : t.file.files[0];
                return new Promise(function(a, u) {
                    var e = E ? l._createCosOptionsWXMiniApp(t) : l._createCosOptionsWeb(t), c = l;
                    l._cosUploadMethod(e, function(e, t) {
                        var n = Object.create(null);
                        if (t) {
                            if (l._isUploadError(t, e)) return u(t.files[0].error), $.warn("UploadController.upload failed, network error:".concat(t.files[0].error.error)), 
                            void p.setCode(Qe).setMessage(on).setEnd();
                            n.fileName = h.name, n.fileSize = h.size, n.fileType = h.type.slice(h.type.indexOf("/") + 1).toLowerCase(), 
                            n.location = E ? t.Location : t.files[0].data.Location;
                            var r = $.timeEnd(fo), o = c._formatFileSize(h.size), i = c._formatSpeed(1e3 * h.size / r), s = "size=".concat(o, ",time=").concat(r, "ms,speed=").concat(i);
                            return $.log("UploadController.upload success name=".concat(h.name, ",").concat(s)), 
                            a(n), void p.setCode(0).setNetworkType(l.getNetworkType()).setText(s).setEnd();
                        }
                        p.setCode(Qe).setMessage(on).setEnd(), $.warn("UploadController.upload failed, error:".concat(e)), 
                        u(e);
                    });
                });
            }
        }, {
            key: "_isUploadError",
            value: function(e, t) {
                return E ? t ? 1 : 0 : null !== e.files[0].error ? 1 : 0;
            }
        }, {
            key: "_formatFileSize",
            value: function(e) {
                return e < 1024 ? e + "B" : e < 1048576 ? Math.floor(e / 1024) + "KB" : Math.floor(e / 1048576) + "MB";
            }
        }, {
            key: "_formatSpeed",
            value: function(e) {
                return e <= 1048576 ? (e / 1024).toFixed(1) + "KB/s" : (e / 1048576).toFixed(1) + "MB/s";
            }
        }, {
            key: "_createCosOptionsWeb",
            value: function(t) {
                var e = this.tim.context.identifier;
                return {
                    files: [ {
                        Bucket: "".concat(this.bucketName, "-").concat(this.appid),
                        Region: this.region,
                        Key: "imfiles/".concat(e, "/").concat(t.to, "-").concat(fe(9999999), "-").concat(t.file.files[0].name),
                        Body: t.file.files[0]
                    } ],
                    SliceSize: 1048576,
                    onProgress: function(e) {
                        if ("function" == typeof t.onProgress) try {
                            t.onProgress(e.percent);
                        } catch (e) {
                            $.warn("onProgress callback error:"), $.error(e);
                        }
                    },
                    onFileFinish: function(e, t, n) {}
                };
            }
        }, {
            key: "_createCosOptionsWXMiniApp",
            value: function(t) {
                var e = this.tim.context.identifier, n = t.file.url;
                return {
                    Bucket: "".concat(this.bucketName, "-").concat(this.appid),
                    Region: this.region,
                    Key: "imfiles/".concat(e, "/").concat(t.to, "-").concat(t.file.name),
                    FilePath: n,
                    onProgress: function(e) {
                        if ($.log(JSON.stringify(e)), "function" == typeof t.onProgress) try {
                            t.onProgress(e.percent);
                        } catch (e) {
                            $.warn("onProgress callback error:"), $.error(e);
                        }
                    }
                };
            }
        } ]), n;
    }(), Ha = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).FILETYPE = {
                SOUND: 2106,
                FILE: 2107,
                VIDEO: 2113
            }, t._bdh_download_server = "grouptalk.c2c.qq.com", t._BDHBizID = 10001, t._authKey = "", 
            t._expireTime = 0, t.tim.innerEmitter.on(Yn, t._getAuthKey, f(t)), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_getAuthKey",
            value: function() {
                var t = this, e = this.createPackage({
                    name: "bigDataHallwayAuthKey",
                    action: "query"
                });
                this.tim.connectionController.request(e).then(function(e) {
                    e.data.authKey && (t._authKey = e.data.authKey, t._expireTime = parseInt(e.data.expireTime));
                });
            }
        }, {
            key: "_isFromOlderVersion",
            value: function(e) {
                return 2 !== e.content.downloadFlag ? 1 : 0;
            }
        }, {
            key: "parseElements",
            value: function(e, t) {
                if (!ee(e) || !t) return [];
                for (var n = [], r = null, o = 0; o < e.length; o++) r = e[o], this._needParse(r) ? n.push(this._parseElement(r, t)) : n.push(e[o]);
                return n;
            }
        }, {
            key: "_needParse",
            value: function(e) {
                return !this._isFromOlderVersion(e) || e.type !== B.MSG_AUDIO && e.type !== B.MSG_FILE && e.type !== B.MSG_VIDEO ? 0 : 1;
            }
        }, {
            key: "_parseElement",
            value: function(e, t) {
                switch (e.type) {
                  case B.MSG_AUDIO:
                    return this._parseAudioElement(e, t);

                  case B.MSG_FILE:
                    return this._parseFileElement(e, t);

                  case B.MSG_VIDEO:
                    return this._parseVideoElement(e, t);
                }
            }
        }, {
            key: "_parseAudioElement",
            value: function(e, t) {
                return e.content.url = this._genAudioUrl(e.content.uuid, t), e;
            }
        }, {
            key: "_parseFileElement",
            value: function(e, t) {
                return e.content.url = this._genFileUrl(e.content.uuid, t, e.content.fileName), 
                e;
            }
        }, {
            key: "_parseVideoElement",
            value: function(e, t) {
                return e.content.url = this._genVideoUrl(e.content.uuid, t), e;
            }
        }, {
            key: "_genAudioUrl",
            value: function(e, t) {
                return "" === this._authKey ? ($.warn("BigDataHallwayController._genAudioUrl no authKey!"), 
                "") : "https://".concat(this._bdh_download_server, "/asn.com/stddownload_common_file?authkey=").concat(this._authKey, "&bid=").concat(this._BDHBizID, "&subbid=").concat(this.tim.context.SDKAppID, "&fileid=").concat(e, "&filetype=").concat(this.FILETYPE.SOUND, "&openid=").concat(t, "&ver=0");
            }
        }, {
            key: "_genFileUrl",
            value: function(e, t, n) {
                return "" === this._authKey ? ($.warn("BigDataHallwayController._genFileUrl no authKey!"), 
                "") : (n || (n = "".concat(Math.floor(1e5 * Math.random()), "-").concat(Date.now())), 
                "https://".concat(this._bdh_download_server, "/asn.com/stddownload_common_file?authkey=").concat(this._authKey, "&bid=").concat(this._BDHBizID, "&subbid=").concat(this.tim.context.SDKAppID, "&fileid=").concat(e, "&filetype=").concat(this.FILETYPE.FILE, "&openid=").concat(t, "&ver=0&filename=").concat(encodeURIComponent(n)));
            }
        }, {
            key: "_genVideoUrl",
            value: function(e, t) {
                return "" === this._authKey ? ($.warn("BigDataHallwayController._genVideoUrl no authKey!"), 
                "") : "https://".concat(this._bdh_download_server, "/asn.com/stddownload_common_file?authkey=").concat(this._authKey, "&bid=").concat(this._BDHBizID, "&subbid=").concat(this.tim.context.SDKAppID, "&fileid=").concat(e, "&filetype=").concat(this.FILETYPE.VIDEO, "&openid=").concat(t, "&ver=0");
            }
        }, {
            key: "reset",
            value: function() {
                this._authKey = "", this.expireTime = 0;
            }
        } ]), n;
    }(), ja = {
        app_id: "",
        event_id: "",
        api_base: "https://pingtas.qq.com/pingd",
        prefix: "_mta_",
        version: "1.3.9",
        stat_share_app: 0,
        stat_pull_down_fresh: 0,
        stat_reach_bottom: 0,
        stat_param: 1
    };
    function Va() {
        try {
            var e = "s" + Ka();
            return wx.setStorageSync(ja.prefix + "ssid", e), e;
        } catch (e) {}
    }
    function Ka(e) {
        for (var t = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], n = 10; 1 < n; n--) {
            var r = Math.floor(10 * Math.random()), o = t[r];
            t[r] = t[n - 1], t[n - 1] = o;
        }
        for (n = r = 0; n < 5; n++) r = 10 * r + t[n];
        return (e || "") + (r + "") + +new Date();
    }
    function $a() {
        try {
            var e = getCurrentPages(), t = "/";
            return 0 < e.length && (t = e.pop().__route__), t;
        } catch (e) {
            console.log("get current page path error:" + e);
        }
    }
    function za() {
        var e, t, n = {
            dm: "wechat.apps.xx",
            url: encodeURIComponent($a() + Xa(Ja.Data.pageQuery)),
            pvi: "",
            si: "",
            ty: 0
        };
        return n.pvi = ((e = function() {
            try {
                return wx.getStorageSync(ja.prefix + "auid");
            } catch (e) {}
        }()) || (e = function() {
            try {
                var e = Ka();
                return wx.setStorageSync(ja.prefix + "auid", e), e;
            } catch (e) {}
        }(), n.ty = 1), e), n.si = ((t = function() {
            try {
                return wx.getStorageSync(ja.prefix + "ssid");
            } catch (e) {}
        }()) || (t = Va()), t), n;
    }
    function Ya() {
        var e, t = (e = wx.getSystemInfoSync(), {
            adt: encodeURIComponent(e.model),
            scl: e.pixelRatio,
            scr: e.windowWidth + "x" + e.windowHeight,
            lg: e.language,
            fl: e.version,
            jv: encodeURIComponent(e.system),
            tz: encodeURIComponent(e.platform)
        });
        return wx.getNetworkType({
            success: function(e) {
                !function(e) {
                    try {
                        wx.setStorageSync(ja.prefix + "ntdata", e);
                    } catch (e) {}
                }(e.networkType);
            }
        }), t.ct = wx.getStorageSync(ja.prefix + "ntdata") || "4g", t;
    }
    function Wa() {
        var e, t = Ja.Data.userInfo, n = [];
        for (e in t) t.hasOwnProperty(e) && n.push(e + "=" + t[e]);
        return t = n.join(";"), {
            r2: ja.app_id,
            r4: "wx",
            ext: "v=" + ja.version + (null !== t && "" !== t ? ";ui=" + encodeURIComponent(t) : "")
        };
    }
    function Xa(e) {
        if (!ja.stat_param || !e) return "";
        e = function(e) {
            if (ja.ignore_params.length < 1) return e;
            var t, n = {};
            for (t in e) 0 <= ja.ignore_params.indexOf(t) || (n[t] = e[t]);
            return n;
        }(e);
        var t, n = [];
        for (t in e) n.push(t + "=" + e[t]);
        return 0 < n.length ? "?" + n.join("&") : "";
    }
    var Ja = {
        App: {
            init: function(e) {
                "appID" in e && (ja.app_id = e.appID), "eventID" in e && (ja.event_id = e.eventID), 
                "statShareApp" in e && (ja.stat_share_app = e.statShareApp), "statPullDownFresh" in e && (ja.stat_pull_down_fresh = e.statPullDownFresh), 
                "statReachBottom" in e && (ja.stat_reach_bottom = e.statReachBottom), "ignoreParams" in e && (ja.ignore_params = e.ignoreParams), 
                "statParam" in e && (ja.stat_param = e.statParam), Va();
                try {
                    "lauchOpts" in e && (Ja.Data.lanchInfo = e.lauchOpts, Ja.Data.lanchInfo.landing = 1);
                } catch (e) {}
                var n;
                "autoReport" in e && e.autoReport && (n = Page, Page = function(e) {
                    var t = e.onLoad;
                    e.onLoad = function(e) {
                        t && t.call(this, e), Ja.Data.lastPageQuery = Ja.Data.pageQuery, Ja.Data.pageQuery = e, 
                        Ja.Data.lastPageUrl = Ja.Data.pageUrl, Ja.Data.pageUrl = $a(), Ja.Data.show = 0, 
                        Ja.Page.init();
                    }, n(e);
                });
            }
        },
        Page: {
            init: function() {
                var t, e, n, r, o = getCurrentPages()[getCurrentPages().length - 1];
                o.onShow && (t = o.onShow, o.onShow = function() {
                    if (1 == Ja.Data.show) {
                        var e = Ja.Data.lastPageQuery;
                        Ja.Data.lastPageQuery = Ja.Data.pageQuery, Ja.Data.pageQuery = e, Ja.Data.lastPageUrl = Ja.Data.pageUrl, 
                        Ja.Data.pageUrl = $a();
                    }
                    Ja.Data.show = 1, Ja.Page.stat(), t.apply(this, arguments);
                }), ja.stat_pull_down_fresh && o.onPullDownRefresh && (r = o.onPullDownRefresh, 
                o.onPullDownRefresh = function() {
                    Ja.Event.stat(ja.prefix + "pulldownfresh", {
                        url: o.__route__
                    }), r.apply(this, arguments);
                }), ja.stat_reach_bottom && o.onReachBottom && (n = o.onReachBottom, o.onReachBottom = function() {
                    Ja.Event.stat(ja.prefix + "reachbottom", {
                        url: o.__route__
                    }), n.apply(this, arguments);
                }), ja.stat_share_app && o.onShareAppMessage && (e = o.onShareAppMessage, o.onShareAppMessage = function() {
                    return Ja.Event.stat(ja.prefix + "shareapp", {
                        url: o.__route__
                    }), e.apply(this, arguments);
                });
            },
            multiStat: function(e, t) {
                if (1 == t) Ja.Page.stat(e); else {
                    var n = getCurrentPages()[getCurrentPages().length - 1];
                    n.onShow && (r = n.onShow, n.onShow = function() {
                        Ja.Page.stat(e), r.call(this, arguments);
                    });
                }
                var r;
            },
            stat: function(e) {
                if ("" != ja.app_id) {
                    var t = [], n = Wa();
                    if (e && (n.r2 = e), e = [ za(), n, Ya() ], Ja.Data.lanchInfo) {
                        e.push({
                            ht: Ja.Data.lanchInfo.scene
                        }), Ja.Data.pageQuery && Ja.Data.pageQuery._mta_ref_id && e.push({
                            rarg: Ja.Data.pageQuery._mta_ref_id
                        });
                        try {
                            1 == Ja.Data.lanchInfo.landing && (n.ext += ";lp=1", Ja.Data.lanchInfo.landing = 0);
                        } catch (e) {}
                    }
                    e.push({
                        rdm: "/",
                        rurl: Ja.Data.lastPageUrl.length <= 0 ? Ja.Data.pageUrl + Xa(Ja.Data.lastPageQuery) : encodeURIComponent(Ja.Data.lastPageUrl + Xa(Ja.Data.lastPageQuery))
                    }), e.push({
                        rand: +new Date()
                    }), n = 0;
                    for (var r = e.length; n < r; n++) for (var o in e[n]) e[n].hasOwnProperty(o) && t.push(o + "=" + (void 0 === e[n][o] ? "" : e[n][o]));
                    wx.request({
                        url: ja.api_base + "?" + t.join("&").toLowerCase()
                    });
                }
            }
        },
        Event: {
            stat: function(e, t) {
                if ("" != ja.event_id) {
                    var n = [], r = za(), o = Wa();
                    r.dm = "wxapps.click", r.url = e, o.r2 = ja.event_id;
                    var i, s = void 0 === t ? {} : t, a = [];
                    for (i in s) s.hasOwnProperty(i) && a.push(encodeURIComponent(i) + "=" + encodeURIComponent(s[i]));
                    for (s = a.join(";"), o.r5 = s, s = 0, o = (r = [ r, o, Ya(), {
                        rand: +new Date()
                    } ]).length; s < o; s++) for (var u in r[s]) r[s].hasOwnProperty(u) && n.push(u + "=" + (void 0 === r[s][u] ? "" : r[s][u]));
                    wx.request({
                        url: ja.api_base + "?" + n.join("&").toLowerCase()
                    });
                }
            }
        },
        Data: {
            userInfo: null,
            lanchInfo: null,
            pageQuery: null,
            lastPageQuery: null,
            pageUrl: "",
            lastPageUrl: "",
            show: 0
        }
    }, Qa = Ja, Za = function() {
        function e() {
            a(this, e), this.cache = [], this.MtaWX = null, this._init();
        }
        return i(e, [ {
            key: "report",
            value: function(e, t) {
                var r = this;
                try {
                    T ? window.MtaH5 ? (window.MtaH5.clickStat(e, t), this.cache.forEach(function(e) {
                        var t = e.name, n = e.param;
                        window.MtaH5.clickStat(t, n), r.cache.shift();
                    })) : this.cache.push({
                        name: e,
                        param: t
                    }) : E && (this.MtaWX ? (this.MtaWX.Event.stat(e, t), this.cache.forEach(function(e) {
                        var t = e.name, n = e.param;
                        r.MtaWX.stat(t, n), r.cache.shift();
                    })) : this.cache.push({
                        name: e,
                        param: t
                    }));
                } catch (e) {}
            }
        }, {
            key: "stat",
            value: function() {
                try {
                    T && window.MtaH5 ? window.MtaH5.pgv() : E && this.MtaWX && this.MtaWX.Page.stat();
                } catch (e) {}
            }
        }, {
            key: "_init",
            value: function() {
                try {
                    if (T) {
                        window._mtac = {
                            autoReport: 0
                        };
                        var e = document.createElement("script"), t = ve();
                        e.src = "".concat(t, "//pingjs.qq.com/h5/stats.js?v2.0.4"), e.setAttribute("name", "MTAH5"), 
                        e.setAttribute("sid", "500690998"), e.setAttribute("cid", "500691017");
                        var n = document.getElementsByTagName("script")[0];
                        n.parentNode.insertBefore(e, n);
                    } else E && (this.MtaWX = Qa, this.MtaWX.App.init({
                        appID: "500690995",
                        eventID: "500691014",
                        autoReport: 0,
                        statParam: 1
                    }));
                } catch (e) {}
            }
        } ]), e;
    }(), eu = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).tim = e, t.MTA = new Za(), 
            t._initListener(), t;
        }
        return u(n, Yr), i(n, [ {
            key: "_initListener",
            value: function() {
                var e = this;
                this.tim.innerEmitter.on(br, function() {
                    e.MTA.report("sdkappid", {
                        value: e.tim.context.SDKAppID
                    }), e.MTA.report("version", {
                        value: hu.VERSION
                    }), e.MTA.stat();
                });
            }
        } ]), n;
    }(), tu = function() {
        function t(e) {
            a(this, t), this._table = "timwebii", this._report = [];
        }
        return i(t, [ {
            key: "pushIn",
            value: function(e) {
                $.debug("SSOLogBody.pushIn", this._report.length, e), this._report.push(e);
            }
        }, {
            key: "backfill",
            value: function(e) {
                var t;
                ee(e) && 0 !== e.length && ($.debug("SSOLogBody.backfill", this._report.length, e.length), 
                (t = this._report).unshift.apply(t, m(e)));
            }
        }, {
            key: "getLogsNumInMemory",
            value: function() {
                return this._report.length;
            }
        }, {
            key: "isEmpty",
            value: function() {
                return 0 === this._report.length;
            }
        }, {
            key: "_reset",
            value: function() {
                this._report.length = 0, this._report = [];
            }
        }, {
            key: "getTable",
            value: function() {
                return this._table;
            }
        }, {
            key: "getLogsInMemory",
            value: function() {
                var e = this._report.slice();
                return this._reset(), e;
            }
        } ]), t;
    }(), nu = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).TAG = "im-ssolog-event", t._reportBody = new tu(), 
            t._version = r, t.MIN_THRESHOLD = 20, t.MAX_THRESHOLD = 100, t.WAITING_TIME = 6e4, 
            t.INTERVAL = 2e4, t._timerID = 0, t._resetLastReportTime(), t._startReportTimer(), 
            t._retryCount = 0, t.MAX_RETRY_COUNT = 3, t.tim.innerEmitter.on(kr, t._onLoginSuccess, f(t)), 
            t;
        }
        return u(n, Yr), i(n, [ {
            key: "reportAtOnce",
            value: function() {
                $.debug("EventStatController.reportAtOnce"), this._report();
            }
        }, {
            key: "_onLoginSuccess",
            value: function() {
                var t = this, e = this.tim.storage, n = e.getItem(this.TAG, 0);
                ke(n) || ($.log("EventStatController._onLoginSuccess get ssolog in storage, nums=" + n.length), 
                n.forEach(function(e) {
                    t._reportBody.pushIn(e);
                }), e.removeItem(this.TAG, 0));
            }
        }, {
            key: "pushIn",
            value: function(e) {
                e instanceof go && (e.setCommonInfo(this.tim.context.SDKAppID, this._version, this.tim.context.tinyID, this.tim.loginInfo.identifier, this.getPlatform()), 
                this._reportBody.pushIn(e), this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD && this._report());
            }
        }, {
            key: "_resetLastReportTime",
            value: function() {
                this._lastReportTime = Date.now();
            }
        }, {
            key: "_startReportTimer",
            value: function() {
                var e = this;
                this._timerID = setInterval(function() {
                    Date.now() < e._lastReportTime + e.WAITING_TIME || e._reportBody.isEmpty() || e._report();
                }, this.INTERVAL);
            }
        }, {
            key: "_stopReportTimer",
            value: function() {
                0 < this._timerID && (clearInterval(this._timerID), this._timerID = 0);
            }
        }, {
            key: "_report",
            value: function() {
                var t = this;
                if (!this._reportBody.isEmpty()) {
                    var n = this._reportBody.getLogsInMemory(), e = this.createPackage({
                        name: "ssoEventStat",
                        action: "create",
                        param: {
                            table: this._reportBody.getTable(),
                            report: n
                        }
                    });
                    this.tim.connectionController.request(e).then(function() {
                        t._resetLastReportTime(), 0 < t._retryCount && ($.debug("EventStatController.report retry success"), 
                        t._retryCount = 0);
                    }).catch(function(e) {
                        if ($.warn("EventStatController.report, online:".concat(t.getNetworkType(), " error:"), e), 
                        t._reportBody.backfill(n), t._reportBody.getLogsNumInMemory() > t.MAX_THRESHOLD || t._retryCount === t.MAX_RETRY_COUNT || 0 === t._timerID) return t._retryCount = 0, 
                        void t._flushAtOnce();
                        t._retryCount += 1;
                    });
                }
            }
        }, {
            key: "_flushAtOnce",
            value: function() {
                var e = this.tim.storage, t = e.getItem(this.TAG, 0), n = this._reportBody.getLogsInMemory();
                if (ke(t)) $.log("EventStatController._flushAtOnce nums=" + n.length), e.setItem(this.TAG, n, 1, 0); else {
                    var r = n.concat(t);
                    r.length > this.MAX_THRESHOLD && (r = r.slice(0, this.MAX_THRESHOLD)), $.log("EventStatController._flushAtOnce nums=" + r.length), 
                    e.setItem(this.TAG, r, 1, 0);
                }
            }
        }, {
            key: "reset",
            value: function() {
                $.log("EventStatController.reset"), this._stopReportTimer(), this._report();
            }
        } ]), n;
    }(), ru = "none", ou = "online", iu = function() {
        function e() {
            a(this, e), this._networkType = "", this.maxWaitTime = 3e3;
        }
        return i(e, [ {
            key: "start",
            value: function() {
                var t = this;
                E ? (wx.getNetworkType({
                    success: function(e) {
                        t._networkType = e.networkType, e.networkType === ru ? $.warn("NetMonitor no network, please check!") : $.info("NetMonitor networkType:".concat(e.networkType));
                    }
                }), wx.onNetworkStatusChange(this._onWxNetworkStatusChange.bind(this))) : this._networkType = ou;
            }
        }, {
            key: "_onWxNetworkStatusChange",
            value: function(e) {
                this._networkType = e.networkType, e.isConnected ? $.info("NetMonitor networkType:".concat(e.networkType)) : $.warn("NetMonitor no network, please check!");
            }
        }, {
            key: "probe",
            value: function() {
                var o = this;
                return new Promise(function(t, e) {
                    if (E) wx.getNetworkType({
                        success: function(e) {
                            o._networkType = e.networkType, e.networkType === ru ? ($.warn("NetMonitor no network, please check!"), 
                            t(0, e.networkType)) : ($.info("NetMonitor networkType:".concat(e.networkType)), 
                            t(1, e.networkType));
                        }
                    }); else {
                        var n = new XMLHttpRequest(), r = setTimeout(function() {
                            $.warn("NetMonitor fetch timeout. Probably no network, please check!"), n.abort(), 
                            o._networkType = ru, t(0, ru);
                        }, o.maxWaitTime);
                        n.onreadystatechange = function() {
                            4 === n.readyState && (clearTimeout(r), 200 === n.status || 304 === n.status ? (this._networkType = ou, 
                            t(1, ou)) : ($.warn("NetMonitor fetch status:".concat(n.status, ". Probably no network, please check!")), 
                            this._networkType = ru, t(0, ru)));
                        }, n.open("GET", "".concat(ve(), "//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=").concat(Math.random())), 
                        n.send();
                    }
                });
            }
        }, {
            key: "getNetworkType",
            value: function() {
                return this._networkType;
            }
        }, {
            key: "reset",
            value: function() {
                this._networkType = "";
            }
        } ]), e;
    }(), su = function() {
        function n(e) {
            var t = this;
            a(this, n), ee(e) ? (this._map = new Map(), e.forEach(function(e) {
                t._map.set(e, []);
            })) : $.warn("AverageCalculator.constructor need keys");
        }
        return i(n, [ {
            key: "push",
            value: function(e, t) {
                return !te(e) && this._map.has(e) && X(t) ? (this._map.get(e).push(t), 1) : 0;
            }
        }, {
            key: "getSize",
            value: function(e) {
                return te(e) || !this._map.has(e) ? -1 : this._map.get(e).length;
            }
        }, {
            key: "getAvg",
            value: function(e) {
                if (te(e) || !this._map.has(e)) return -1;
                var t = this._map.get(e), n = t.length;
                if (0 === n) return 0;
                var r = 0;
                return t.forEach(function(e) {
                    r += e;
                }), t.length = 0, this._map.set(e, []), parseInt(r / n);
            }
        }, {
            key: "getMax",
            value: function(e) {
                return te(e) || !this._map.has(e) ? -1 : Math.max.apply(null, this._map.get(e));
            }
        }, {
            key: "getMin",
            value: function(e) {
                return te(e) || !this._map.has(e) ? -1 : Math.min.apply(null, this._map.get(e));
            }
        }, {
            key: "reset",
            value: function() {
                this._map.forEach(function(e) {
                    e.length = 0;
                });
            }
        } ]), n;
    }(), au = function() {
        function n(e) {
            var t = this;
            a(this, n), ee(e) ? (this._map = new Map(), e.forEach(function(e) {
                t._map.set(e, {
                    totalCount: 0,
                    successCount: 0
                });
            })) : $.warn("SuccessRateCalculator.constructor need keys");
        }
        return i(n, [ {
            key: "addTotalCount",
            value: function(e) {
                return te(e) || !this._map.has(e) ? 0 : (this._map.get(e).totalCount += 1, 1);
            }
        }, {
            key: "addSuccessCount",
            value: function(e) {
                return te(e) || !this._map.has(e) ? 0 : (this._map.get(e).successCount += 1, 1);
            }
        }, {
            key: "getSuccessRate",
            value: function(e) {
                if (te(e) || !this._map.has(e)) return -1;
                var t = this._map.get(e);
                if (0 === t.totalCount) return 1;
                var n = parseFloat((t.successCount / t.totalCount).toFixed(2));
                return t.totalCount = t.successCount = 0, n;
            }
        }, {
            key: "getTotalCount",
            value: function(e) {
                return te(e) || !this._map.has(e) ? -1 : this._map.get(e).totalCount;
            }
        }, {
            key: "reset",
            value: function() {
                this._map.forEach(function(e) {
                    e.totalCount = 0, e.successCount = 0;
                });
            }
        } ]), n;
    }(), uu = function(e) {
        function n(e) {
            var t;
            return a(this, n), (t = g(this, c(n).call(this, e))).TABLE = "timwebsum", t.TAG = "im-ssolog-sumstat", 
            t._items = [ uo, co, lo ], t._thresholdMap = new Map(), t._thresholdMap.set(uo, 100), 
            t._thresholdMap.set(co, 150), t._thresholdMap.set(lo, 15), t._lpID = "", t._platform = t.getPlatform(), 
            t._lastReportTime = 0, t._statInfoArr = [], t._retryCount = 0, t._avgCalc = new su(t._items), 
            t._successRateCalc = new au(t._items), t.tim.innerEmitter.on(kr, t._onLoginSuccess, f(t)), 
            t;
        }
        return u(n, Yr), i(n, [ {
            key: "_onLoginSuccess",
            value: function() {
                var t = this, e = this.tim.storage, n = e.getItem(this.TAG, 0);
                ke(n) || ($.log("SumStatController._onLoginSuccess get sumstatlog in storage, nums=" + n.length), 
                n.forEach(function(e) {
                    t._statInfoArr.pushIn(e);
                }), e.removeItem(this.TAG, 0));
            }
        }, {
            key: "recordLongPollingID",
            value: function(e) {
                this._lpID = e;
            }
        }, {
            key: "addTotalCount",
            value: function(e) {
                this._successRateCalc.addTotalCount(e) ? 1 === this._successRateCalc.getTotalCount(e) && (this._lastReportTime = Date.now()) : $.warn("SumStatController.addTotalCount invalid key:", e);
            }
        }, {
            key: "addSuccessCount",
            value: function(e) {
                this._successRateCalc.addSuccessCount(e) || $.warn("SumStatController.addSuccessCount invalid key:", e);
            }
        }, {
            key: "addCost",
            value: function(e, t) {
                this._avgCalc.push(e, t) ? ($.debug("SumStatController.addCost", e, t, this._avgCalc.getSize(e)), 
                this._avgCalc.getSize(e) >= this._thresholdMap.get(e) && this._report(e)) : $.warn("SumStatController.addCost invalid key or cost:", e, t);
            }
        }, {
            key: "_getItemNum",
            value: function(e) {
                switch (e) {
                  case uo:
                    return 1;

                  case co:
                    return 2;

                  case lo:
                    return 3;

                  default:
                    return 100;
                }
            }
        }, {
            key: "_getStatInfo",
            value: function(e) {
                var t = null;
                return 0 < this._avgCalc.getSize(e) && (t = {
                    SDKAppID: "".concat(this.tim.context.SDKAppID),
                    version: "".concat(r),
                    tinyID: this.tim.context.tinyID,
                    userID: this.tim.loginInfo.identifier,
                    item: this._getItemNum(e),
                    lpID: e === uo ? this._lpID : "",
                    platform: this._platform,
                    networkType: this.getNetworkType(),
                    total: this._successRateCalc.getTotalCount(e),
                    successRate: this._successRateCalc.getSuccessRate(e),
                    avg: this._avgCalc.getAvg(e),
                    timespan: Date.now() - this._lastReportTime,
                    time: pe()
                }), t;
            }
        }, {
            key: "_report",
            value: function(e) {
                var t = this, n = [], r = null;
                te(e) ? this._items.forEach(function(e) {
                    null !== (r = t._getStatInfo(e)) && n.push(r);
                }) : null !== (r = this._getStatInfo(e)) && n.push(r), $.debug("SumStatController._report", n), 
                0 < this._statInfoArr.length && (n = n.concat(this.statInfoArr), this._statInfoArr = []), 
                this._doReport(n);
            }
        }, {
            key: "_doReport",
            value: function(t) {
                var n = this;
                if (ke(t)) $.warn("SumStatController._doReport statInfoArr is empty, do nothing"); else {
                    var e = this.createPackage({
                        name: "ssoSumStat",
                        action: "create",
                        param: {
                            table: this.TABLE,
                            report: t
                        }
                    });
                    this.tim.connectionController.request(e).then(function() {
                        n._lastReportTime = Date.now(), 0 < n._retryCount && ($.debug("SumStatController._doReport retry success"), 
                        n._retryCount = 0);
                    }).catch(function(e) {
                        $.warn("SumStatController._doReport, online:".concat(n.getNetworkType(), " error:"), e, t), 
                        n._retryCount <= 1 ? setTimeout(function() {
                            $.info("SumStatController._doReport retry", t), n._retryCount += 1, n._doReport(t);
                        }, 5e3) : (n._retryCount = 0, n._statInfoArr = n._statInfoArr.concat(t), n._flusgAtOnce());
                    });
                }
            }
        }, {
            key: "_flushAtOnce",
            value: function() {
                var e = this.tim.storage, t = e.getItem(this.TAG, 0), n = this._statInfoArr;
                if (ke(t)) $.log("SumStatController._flushAtOnce nums=" + n.length), e.setItem(this.TAG, n, 1, 0); else {
                    var r = n.concat(t);
                    10 < r.length && (r = r.slice(0, 10)), $.log("SumStatController._flushAtOnce nums=" + r.length), 
                    e.setItem(this.TAG, r, 1, 0);
                }
                this._statInfoArr = [];
            }
        }, {
            key: "reset",
            value: function() {
                $.info("SumStatController.reset"), this._report(), this._avgCalc.reset(), this._successRateCalc.reset();
            }
        } ]), n;
    }(), cu = function() {
        function n(e) {
            a(this, n);
            var t = new go();
            t.setMethod(mo).setStart(), xr.mixin(this), this._initOptions(e), this._initMemberVariables(), 
            this._initControllers(), this._initListener(), go.bindController(this.eventStatController), 
            t.setCode(0).setText("mp=".concat(E, "-ua=").concat(A)).setEnd(), $.info("SDK inWxMiniApp:".concat(E, ", SDKAppID:").concat(e.SDKAppID, ", UserAgent:").concat(A));
        }
        return i(n, [ {
            key: "login",
            value: function(e) {
                return $.time(so), this._ssoLog = new go(), this._ssoLog.setMethod(yo).setStart(), 
                this.netMonitor.start(), this.loginInfo.identifier = e.identifier || e.userID, this.loginInfo.userSig = e.userSig, 
                this.signController.login(this.loginInfo);
            }
        }, {
            key: "logout",
            value: function() {
                var e = this.signController.logout();
                return this.resetSDK(), e;
            }
        }, {
            key: "on",
            value: function(e, t, n) {
                $.debug("on", "eventName:".concat(e)), this.outerEmitter.on(e, De(t, n), n);
            }
        }, {
            key: "once",
            value: function(e, t, n) {
                $.debug("once", "eventName:".concat(e)), this.outerEmitter.once(e, t, n || this);
            }
        }, {
            key: "off",
            value: function(e, t, n, r) {
                $.debug("off", "eventName:".concat(e)), this.outerEmitter.off(e, t, n, r);
            }
        }, {
            key: "registerPlugin",
            value: function(t) {
                var n = this;
                this.plugins || (this.plugins = {}), Object.keys(t).forEach(function(e) {
                    n.plugins[e] = t[e];
                });
            }
        }, {
            key: "getPlugin",
            value: function(e) {
                return this.plugins[e] || void 0;
            }
        }, {
            key: "setLogLevel",
            value: function(e) {
                e <= 0 && console.log([ "", " ________  ______  __       __  __       __  ________  _______", "|        \\|      \\|  \\     /  \\|  \\  _  |  \\|        \\|       \\", " \\$$$$$$$$ \\$$$$$$| $$\\   /  $$| $$ / \\ | $$| $$$$$$$$| $$$$$$$\\", "   | $$     | $$  | $$$\\ /  $$$| $$/  $\\| $$| $$__    | $$__/ $$", "   | $$     | $$  | $$$$\\  $$$$| $$  $$$\\ $$| $$  \\   | $$    $$", "   | $$     | $$  | $$\\$$ $$ $$| $$ $$\\$$\\$$| $$$$$   | $$$$$$$\\", "   | $$    _| $$_ | $$ \\$$$| $$| $$$$  \\$$$$| $$_____ | $$__/ $$", "   | $$   |   $$ \\| $$  \\$ | $$| $$$    \\$$$| $$     \\| $$    $$", "    \\$$    \\$$$$$$ \\$$      \\$$ \\$$      \\$$ \\$$$$$$$$ \\$$$$$$$", "", "参考以下文档，会更快解决问题哦！(#^.^#)\n", "SDK 更新日志: https://cloud.tencent.com/document/product/269/38492\n", "SDK 接口文档: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html\n", "常见问题: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/tutorial-01-faq.html\n", "反馈问题？戳我提 issue: https://github.com/tencentyun/TIMSDK/issues\n", "如果您需要在生产环境关闭上面的日志，请 tim.setLogLevel(1)\n" ].join("\n")), 
                $.setLevel(e);
            }
        }, {
            key: "downloadLog",
            value: function() {
                var e = document.createElement("a"), t = new Date(), n = new Blob(this.getLog());
                e.download = "TIM-" + t.getFullYear() + "-" + (t.getMonth() + 1) + "-" + t.getDate() + "-" + this.loginInfo.SDKAppID + "-" + this.context.identifier + ".txt", 
                e.href = URL.createObjectURL(n), e.click(), URL.revokeObjectURL(n);
            }
        }, {
            key: "destroy",
            value: function() {
                this.logout(), this.outerEmitter.emit(l.SDK_DESTROY, {
                    SDKAppID: this.loginInfo.SDKAppID
                });
            }
        }, {
            key: "createTextMessage",
            value: function(e) {
                return this.messageController.createTextMessage(e);
            }
        }, {
            key: "createImageMessage",
            value: function(e) {
                return this.messageController.createImageMessage(e);
            }
        }, {
            key: "createAudioMessage",
            value: function(e) {
                return this.messageController.createAudioMessage(e);
            }
        }, {
            key: "createVideoMessage",
            value: function(e) {
                return this.messageController.createVideoMessage(e);
            }
        }, {
            key: "createCustomMessage",
            value: function(e) {
                return this.messageController.createCustomMessage(e);
            }
        }, {
            key: "createFaceMessage",
            value: function(e) {
                return this.messageController.createFaceMessage(e);
            }
        }, {
            key: "createFileMessage",
            value: function(e) {
                return this.messageController.createFileMessage(e);
            }
        }, {
            key: "sendMessage",
            value: function(e) {
                return e instanceof ha ? this.messageController.sendMessageInstance(e) : io(new qn({
                    code: Fe,
                    message: $t
                }));
            }
        }, {
            key: "resendMessage",
            value: function(e) {
                return this.messageController.resendMessage(e);
            }
        }, {
            key: "getMessageList",
            value: function(e) {
                return this.messageController.getMessageList(e);
            }
        }, {
            key: "setMessageRead",
            value: function(e) {
                return this.messageController.setMessageRead(e);
            }
        }, {
            key: "getConversationList",
            value: function() {
                return this.conversationController.getConversationList();
            }
        }, {
            key: "getConversationProfile",
            value: function(e) {
                return this.conversationController.getConversationProfile(e);
            }
        }, {
            key: "deleteConversation",
            value: function(e) {
                return this.conversationController.deleteConversation(e);
            }
        }, {
            key: "getMyProfile",
            value: function() {
                return this.userController.getMyProfile();
            }
        }, {
            key: "getUserProfile",
            value: function(e) {
                return this.userController.getUserProfile(e);
            }
        }, {
            key: "updateMyProfile",
            value: function(e) {
                return this.userController.updateMyProfile(e);
            }
        }, {
            key: "getFriendList",
            value: function() {
                return this.userController.getFriendList();
            }
        }, {
            key: "deleteFriend",
            value: function(e) {
                return this.userController.deleteFriend(e);
            }
        }, {
            key: "getBlacklist",
            value: function() {
                return this.userController.getBlacklist();
            }
        }, {
            key: "addToBlacklist",
            value: function(e) {
                return this.userController.addBlacklist(e);
            }
        }, {
            key: "removeFromBlacklist",
            value: function(e) {
                return this.userController.deleteBlacklist(e);
            }
        }, {
            key: "getGroupList",
            value: function(e) {
                return this.groupController.getGroupList(e);
            }
        }, {
            key: "getGroupProfile",
            value: function(e) {
                return this.groupController.getGroupProfile(e);
            }
        }, {
            key: "createGroup",
            value: function(e) {
                return this.groupController.createGroup(e);
            }
        }, {
            key: "dismissGroup",
            value: function(e) {
                return this.groupController.dismissGroup(e);
            }
        }, {
            key: "updateGroupProfile",
            value: function(e) {
                return this.groupController.updateGroupProfile(e);
            }
        }, {
            key: "joinGroup",
            value: function(e) {
                return this.groupController.joinGroup(e);
            }
        }, {
            key: "quitGroup",
            value: function(e) {
                return this.groupController.quitGroup(e);
            }
        }, {
            key: "searchGroupByID",
            value: function(e) {
                return this.groupController.searchGroupByID(e);
            }
        }, {
            key: "changeGroupOwner",
            value: function(e) {
                return this.groupController.changeGroupOwner(e);
            }
        }, {
            key: "handleGroupApplication",
            value: function(e) {
                return this.groupController.handleGroupApplication(e);
            }
        }, {
            key: "setMessageRemindType",
            value: function(e) {
                return this.groupController.setMessageRemindType(e);
            }
        }, {
            key: "getGroupMemberList",
            value: function(e) {
                return this.groupController.getGroupMemberList(e);
            }
        }, {
            key: "getGroupMemberProfile",
            value: function(e) {
                return this.groupController.getGroupMemberProfile(e);
            }
        }, {
            key: "addGroupMember",
            value: function(e) {
                return this.groupController.addGroupMember(e);
            }
        }, {
            key: "deleteGroupMember",
            value: function(e) {
                return this.groupController.deleteGroupMember(e);
            }
        }, {
            key: "setGroupMemberMuteTime",
            value: function(e) {
                return this.groupController.setGroupMemberMuteTime(e);
            }
        }, {
            key: "setGroupMemberRole",
            value: function(e) {
                return this.groupController.setGroupMemberRole(e);
            }
        }, {
            key: "setGroupMemberNameCard",
            value: function(e) {
                return this.groupController.setGroupMemberNameCard(e);
            }
        }, {
            key: "setGroupMemberCustomField",
            value: function(e) {
                return this.groupController.setGroupMemberCustomField(e);
            }
        }, {
            key: "_initOptions",
            value: function(e) {
                this.plugins = {}, this.loginInfo = {
                    SDKAppID: e.SDKAppID || null,
                    accountType: fe(),
                    identifier: null,
                    userSig: null
                }, this.options = {
                    runLoopNetType: e.runLoopNetType || 2,
                    enablePointer: e.enablePointer || 0
                };
            }
        }, {
            key: "_initMemberVariables",
            value: function() {
                var e;
                this.context = null, this.innerEmitter = new Ga(), this.outerEmitter = new Ga(), 
                e = this.outerEmitter, ro = e, this.packageConfig = new qa(this), this.storage = new Na(this), 
                this.netMonitor = new iu(), this.outerEmitter._emit = this.outerEmitter.emit, this.outerEmitter.emit = function(e, t) {
                    var n = e, r = [ n, {
                        name: e,
                        data: t
                    } ];
                    $.debug("emit ".concat(n), r[1]), this.outerEmitter._emit.apply(this.outerEmitter, r);
                }.bind(this);
            }
        }, {
            key: "_initControllers",
            value: function() {
                this.exceptionController = new Hs(this), this.connectionController = new xs(this), 
                this.contextController = new Xr(this), this.signController = new Po(this), this.messageController = new Sa(this), 
                this.conversationController = new ya(this), this.userController = new Zs(this), 
                this.groupController = new La(this), this.notificationController = new Fa(this), 
                this.bigDataHallwayController = new Ha(this), this.statusController = new Oa(this), 
                this.uploadController = new Ba(this), this.eventStatController = new nu(this), this.sumStatController = new uu(this), 
                this.mtaReportController = new eu(this), this._initReadyListener();
            }
        }, {
            key: "_initListener",
            value: function() {
                var e = this;
                if (this.innerEmitter.on(lr, this._onNoticeChannelReconnectedAfterLongTime, this), 
                E && "function" == typeof wx.onAppShow && "function" == typeof wx.onAppHide) {
                    var t = null;
                    wx.onAppHide(function() {
                        (t = new go()).setMethod(Ro).setStart();
                    }), wx.onAppShow(function() {
                        null !== t && t.setCode(0).setNetworkType(e.netMonitor.getNetworkType()).setEnd();
                    });
                }
            }
        }, {
            key: "_initReadyListener",
            value: function() {
                for (var e = this, t = this.readyList, n = 0, r = t.length; n < r; n++) this[t[n]].ready(function() {
                    return e._readyHandle();
                });
            }
        }, {
            key: "_onNoticeChannelReconnectedAfterLongTime",
            value: function(e) {
                $.log("reconnect after long time...", e), this.notificationController.closeNoticeChannel(), 
                this.resetSDK(), this.login(this.loginInfo);
            }
        }, {
            key: "resetSDK",
            value: function() {
                var t = this;
                this.initList.forEach(function(e) {
                    t[e].reset && t[e].reset();
                }), this.netMonitor.reset(), this.storage.reset(), this.resetReady(), this._initReadyListener(), 
                this.outerEmitter.emit(l.SDK_NOT_READY);
            }
        }, {
            key: "_readyHandle",
            value: function() {
                for (var e = this.readyList, t = 1, n = 0, r = e.length; n < r; n++) if (!this[e[n]].isReady()) {
                    t = 0;
                    break;
                }
                if (t) {
                    var o = $.timeEnd(so);
                    $.warn("SDK is ready. cost=".concat(o, "ms")), this.triggerReady(), this.innerEmitter.emit(br), 
                    this.outerEmitter.emit(l.SDK_READY), this._ssoLog.setCode(0).setNetworkType(this.netMonitor.getNetworkType()).setText(o).setEnd();
                }
            }
        } ]), n;
    }();
    cu.prototype.readyList = [ "conversationController" ], cu.prototype.initList = [ "exceptionController", "connectionController", "signController", "contextController", "messageController", "conversationController", "userController", "groupController", "notificationController", "eventStatController", "sumStatController" ];
    var lu = {
        login: "login",
        on: "on",
        off: "off",
        ready: "ready",
        setLogLevel: "setLogLevel",
        joinGroup: "joinGroup",
        quitGroup: "quitGroup",
        registerPlugin: "registerPlugin"
    };
    var pu = {}, hu = {};
    return hu.create = function(e) {
        if (e.SDKAppID && pu[e.SDKAppID]) return pu[e.SDKAppID];
        $.log("TIM.create");
        var t = new cu(e);
        t.on(l.SDK_DESTROY, function(e) {
            pu[e.data.SDKAppID] = null, delete pu[e.data.SDKAppID];
        });
        var o, i, n = (o = t, i = Object.create(null), Object.keys(Ae).forEach(function(n) {
            if (o[n]) {
                var r = Ae[n], t = new y();
                i[r] = function() {
                    var e = Array.from(arguments);
                    return t.use(function(e, t) {
                        if (function(e, t, n) {
                            if (e || void 0 !== lu[t]) return 1;
                            n.innerEmitter.emit(Ar, new qn({
                                code: Ot,
                                message: "".concat(Gn, " ").concat(t)
                            }));
                        }(o.isReady(), n, o)) return t();
                    }).use(function(e, t) {
                        if (1 == function(n, r, o) {
                            if (void 0 === r) return 1;
                            var i = 1;
                            if ("object" === k(r).toLowerCase()) Object.keys(r).forEach(function(e) {
                                var t = 1 === n.length ? n[0][e] : void 0;
                                i = Te(t, r[e], o, e) ? i : 0;
                            }); else if ("array" === k(r).toLowerCase()) for (var e = 0; e < r.length; e++) i = Te(n[e], r[e], o, r[e].name) ? i : 0;
                            if (i) return i;
                            throw new Error("Params validate failed.");
                        }(e, Ee[n], r)) return t();
                    }).use(function(e, t) {
                        return o[n].apply(o, e);
                    }), t.run(e);
                };
            }
        }), i);
        return pu[e.SDKAppID] = n, $.log("TIM.create ok"), n;
    }, hu.TYPES = B, hu.EVENT = l, hu.VERSION = r, $.log("TIM.VERSION: ".concat(hu.VERSION)), 
    hu;
});